Taweel's Forum Posts

  • I did a very simple path finding test where the path is "L" shaped. There is one sprite at one end of the path that spawns the enemy sprites. The Enemy needs to find a path to a sprite at the other end of the path.

    It all works fine until I add the "solid" behaviour to my enemy sprite. The enemy sprite fails to find a path!!

    Is that a know issue?

    The reason I want to use the solid behaviour with my enemy is to try to prevent the enemies from overlapping on the path.

    Many thanks in advance for you help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That clears it. Thanks.

  • Thanks for the reply Ashley. You said:

    [quote:2jfimzp0]so unless you call a function (or a trigger runs) everything will happen in the exact order you specify.

    I have my enemy creation done with a time trigger. First type of enemy is created every 3s, Second type every 5s and third every 7s.

    Does that mean if the time trigger happens for 2nd enemy, it could interrupt the event triggered by the first enemy? If that happens then I can see a potential problem in the way I am creating the enemies.

    If so, is there a better way to create enemies and link them to their health bar that doesn't suffer this issue?

    Thanks again.

  • Hello,

    I am still in the learning phase so this is probably trivial for the advanced developers among you.

    I tried looking for the answer but I couldn't find it. Probably I am not using the correct keywords.

    Basically, I am trying to assign a "health bar" to an enemy. The advice I read was to avoid the UIDs. I am using a global variable instead that gets incremented every time an enemy is created. It goes something like this:

    1- Create enemy.

    2- Increment global_var.

    3- Assign global_var to enemy.local_var

    4- spawn a health bar.

    5- assign enemy.local_var to health bar.local_var.

    6- Pin health bar to global var.

    Am I guaranteed that steps 2 and 3 (part of the same event) will happen without interruption? Can another enemy creation event happen in a different thread and cause the global_var to be incremented between steps 2 and 3?

    Many thanks.