help with enemy follow sprite

Get help using Construct 2

Post » Wed Dec 25, 2013 2:27 am

can any one help me with this i can't get enemy to change moving direction when passed by player.
Posts: 54
Reputation: 1,001

Post » Wed Dec 25, 2013 3:38 am


When you use mirrored, it changes the angle of the sprite, so it changes the LOS too. In your example, if you remove 'set Mirrored" and add a event "simulate pressing Left", it works.

I made this, I hope is what you need:

It basically does this:

If the X position of badGuy is less then the player X, then the player is in the front of the badGuy. So, "not mirrored". If it is greater, then the player is at the back of badGuy, then I "mirrored" the image.

Then I check if badGuy as a line of sight of the player. If yes, then I make another check to see if badGuy's X is less than or greater than player's X, and move accordingly.

I hope this helps. Martiny2013-12-25 03:51:54
Posts: 15
Reputation: 589

Return to How do I....?

Who is online

Users browsing this forum: plinkie, Syazanie Amirin, Yahoo [Bot] and 4 guests