R0J0hound's Forum Posts

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

  • The idea above it to save the velocity, move, then set the velocity from the saved one. Basically the reason fro this is moving the object changes the velocity, which can be useful for things like using dragndrop to throw physics objects.

    Alternatively the chipmunk behavior works fine with the wrap behavior by default.

  • hmann128

    There are a few ways to do it. The simplest is to make the objects global so they won't be destroyed when the layout changes.

    Another idea is to store the object's info in an array, then looping over the array to re-create from that. Here's one possible example:

    This may be an overkill for what you want, but the idea is there.

  • I'm not sure how much help I'll be. I mean I could come up with something like alextro, but nothing would be exactly what you had in mind. I guess we could go back and forth with you saying what's wrong and me then fixing them, but that would just be me making your game.

  • I think the wait tutorial shows a similar example but this would work:

    a=1

    trigger once

    repeat 3 times

    --- wait loopindex*0.2 seconds

    --- set opacity to 0

    --- wait loopindex*0.2+0.1 seconds

    --- set opacity to 100