Im trying to make sprites stop at a base and any sprites behind it stop and wait till that one dies

0 favourites
  • 2 posts
From the Asset Store
Be discreet and rescue your friends from behind enemy lines.
  • Im making an age of war type game and im attempting to have my friendly units stop once they reach the enemy base which i have set up with line of sight. This worked at first but then any other knights i had kept on moving forward and caused the stopped on to start moving and go off screen. I do have a event where if a knight is in front of another knight it will stop and set its speed to 0 and then call for a instance variable of ""Is moving" when the variable is called it sets the bullet speed and waits. then i have it call for an instance of "is moving" = 0 which means to stop and then once the one in front starts to move again it will set "is moving"=1 which i have making the ones behind it continue to move at that point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would first deal with the initial halt logic before trying to implement the knight detecting other knights. It's not as easy as it sounds to do this kind of stuff for multiple enemies, sure it will work perfectly for one instance but then seem to break when you add more. You have to ensure the picking logic is sound, I usually do this with functions and you can pass UID through this to ensure you are picking the correct sprite. When a knight reaches the end of the level you need to then pick all knights and stop them. If the other issue is that knights move with the move variables and override the general halt logic then you need to add another variable with a condition that makes sure this logic isnt used when everyone has stopped.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)