How do I correctly use Tile Movement for Enemies?

0 favourites
  • 2 posts
From the Asset Store
slide the tiles to fill the board.60 awesome levels.
  • Hi there everyone, I'm hoping someone far better than me can offer a hand here. This is the runtime I have for my enemies (who use the Tile Movement behaviour). Basically what I'm trying to achieve is the enemy using the tile movement behaviour to walk towards the player X number of times.

    Each enemy (family) has a variable called Number_Tiles which in this enemies instance is set to 2. So therefore every time the End of the Turn is called it should run the movement function twice for that enemy.

    However, this seems to only allow the enemy to move once (even when their movement count is 2, when they should move twice).

    Many many thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's too much going on here and you cut off the top part of that important event in the screenshot. The first problem is that even though you run the function for each enemy, inside the function it doesn't automatically relate to that enemy, you need to pick it again inside the function by passing through a parameter. In the top event there are too many conditions really and is it running every tick? I cannot tell as you chopped off the top part of that event.

    Before you repeat you need to make sure it's running correctly one time for an enemy which it probably is not doing unless you have just one enemy in the level. What you could do is move everything inside the function, decrease the variable inside there. Run the function and send the enemy's UID through as a parameter, then inside the function pick the enemy from UID, and use a condition movement variable > 0 and loop through the movements.

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