R0J0hound's Recent Forum Activity

  • You asked the same question before here with normal physics, which you marked as solved after someone posted an example:

    You then asked a question similar to your op here, and got an example:

    You even already asked this in the chipmunk forum, where I responded with a general suggestion, since you weren't specific about what what was wrong other than it doesn't work.

    So in general you're just looking for a completed working example I guess. Applying forces are one of the simplest things to do with physics, and is about the same in chipmunk. The swipe direction I guess could be trickier, but it's just a matter of checking where you first touched to where you're currently touching.

    How do you know where you're currently touching? There's the Touch.x, touch.y expressions.

    How do you know where you first touched? Save the touch location to variables under a "on touch" condition.

    How do you compare the two directions to find a direction? Something simple like a "system compare" with the current touch position and where you first touched.

    I won't make a capx, but you can do events like this:

    global number firstTouchX=0

    on touch:

    --- set firstTouchX to touch.x

    is touching

    touch.x < firstTouchX

    --- apply force (-100,0)

    is touching

    touch.x > firstTouchX

    --- apply force (100,0)

  • "RUNTIME ERROR" is a catch all for crashes. I've thought of some common ways that I've encountered them before, but the cause could be anything. Unfortunately I'm out of ideas.

    If CC was still being developed the crash could be hopefully debugged and fixed, but currently no one is developing it and no one is set up to debug it. The best that can be done is to figure out what is causing the crash and avoiding it. Unfortunately that can be impossible for some more obscure bugs.

  • seven

    The original code in that capx is from taking the code in the effect itself and reversing it. The only snag was in the effect the positions are relative to either the screen or object, in the range of 0 to 1. So 0,0 would be the top left and 1,1 would be the bottom right. So as I recall multiplying by the sprite size was to switch between that and pixels.

    Beyond that I don't have anything helpful to say. If I was to do it I'd probably need to derive the math again so I understand what's what. But I've no time to do that.

  • You'll probably want to make a plugin to do this, or at least modify the one you use. C2 only handles strings or numbers, so the expression as is wont do it.

  • If AirConsole.Message is "{ touch: 999 }" then you could do this the get the value of "touch"

    Browser.ExecJS("var a="&AirConsole.Message&";a.touch")

  • The runtime errors are generally due to the events, not the objects. At this point I guess it can be assumed that the fixer cap does nothing, at least for your cap. You can start disabling events until you identify the offending event, but my money is on the "or" condition. Don't ever use it, it causes crashes. The only other common issue is with instance variables causing runtime errors, but this is less common and there is no fix.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This may give some ideas:

    http://www.redblobgames.com/articles/visibility/

  • It's probably possible.

  • It's probably a bug in my code, but I can't test it without the webgl renderer being used.

  • You could go at it from another angle. You could use a 1x1 sprite and just paste that, or you could just use a tiny tilemap instead of the paster object. If the map doesn't change you could also use the canvas plugin, since it only has a performance hit with webgl if you constantly change the texture.

  • You could do this:

    global number index =0
    
    +------------------------------+
    | while                        | set index to int(random(5,8))
    +------------------------------+
       +---------------------------+
       | array: value at index <99 | array: set at index to 5
       |                           | stop loop
       +---------------------------+[/code:3re0ismd]
    Basically pick a random index until the value isn't 99 before setting the value.
    
    You could probably do it all without an array though.
  • I took a look and the events look correct. I don't use webgl so if there's a webgl related issue I won't see it. The minimap was oriented correctly, but the colors were faded except for the right and bottom edge. I have no idea why that occurs, but using a "additive" blend is on solution.

    Edit:

    Fixed the faded issue in the plugin.