R0J0hound's Recent Forum Activity

  • Also from those expressions you can get the total speed with:

    distance(0, 0, sprite.physics.velocityx, sprite.physics.velocityy)

    You'll need to use system->compare or system->"pick by comparison" to compare it.

  • Run it with the debugger and look at the object counts, they are increasing constantly. You need to move the events that create them to be a sub-event of start of layout.

  • One way to do it is with the overlapping at offset condition. So say the ai sprite's size is 32x32 you could do this:

    [inverted] ai is overlapping ground at offset (-32,32)

    --- ai set angle to 0

    [inverted] ai is overlapping ground at offset (32,32)

    --- ai set angle to 180

  • jogosgratispro

    For a 10x2 array for example, you'd have to swap around not only array.at(curX), but the other values too. But no matter, just use the sort action and don't worry about it.

  • I don't think you need to worry about this. Loading of arrays, even gigantic ones, is negligible, and even then it's only done once. When it comes to arrays the only way it would slow things down is maybe if it's enormous (millions of values or something) and your events loop over it every tick.

  • Using a detector sprite is usually the way to go for keeping grid motion from going into walls. You could also just check the position on the tilemap to see if it's empty (-1).

    You can find some ideas ideas on how to only moving a certain number of squares by searching for "turn based" or "dijkstra".

    I have an oldish example that does that here:

    but the more recent topic here about flood fill pathfinding would be more useful to you:

    Finally your capx is running slow because it's creating all the wall objects every tick.

  • Functions are the typical way to do that, unless you had something else in mind.

  • Colludium

    I can confirm the bug. You can re-arrange it without an else to show the "or" is the only issue:

    every tick:

    --- set text to false

    mouse is overlapping tiledbackground

    -or-

    sprite is overlapping tiledbackground

    --- set text to true

    For me the second condition in the "or" block is always ignored.

  • imothep85

    To keep them from overlapping each other it's the same solution as with the pathfinding behavior:

    ElChuchis

    It's hard to see with those gifs but the way I had it setup is the LOS behavior had a range of about 200. So the waypoints should be less than 200 pixels apart. If a dude hits a waypoint and it can't find another waypoint in LOS within 120 degrees of the direction it won't get a new target, so it will orbit it's last target.

    In mine I also made the bullet behavior bounce off solids to avoid cutting through the buildings. In your gifs that looks to be happening.

  • Here's an idea. You can use the bullet behavior to move the people and the LOS behavior to pick a node to move to.

    https://www.dropbox.com/s/i6s5ga63ws7qv ... .capx?dl=1

    /examples33/city_walk.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is the difference between an actual trigger and a fake trigger.

    "on key press" is an actual trigger and is triggered when the key is pressed.

    "on button pressed" is a fake trigger and is the same as

    "button is down"

    "trigger once"

    More info here:

  • Just make the objects global and destroy them at the start of the first layout.