1
Ask a Question / Re: Platformer Enemy
« on: February 17, 2019, 03:19:55 pm »There's the easy math extension that may be of some help as it lets you easily get values such as the distance between two actors.
http://community.stencyl.com/index.php/topic,27769.0.html
Moving an enemy shouldn't be too difficult. You can check if the player is to the left or right of an enemy by comparing the x-center values of each. Then if the player is within a certain distance, get the enemy to move horizontally towards the player.
Checking and comparing the y-values you can see if the player is within line of sight. If so, shoot towards the player.
Finally, if you don't want your enemies to fall off platforms, you need to check if a tile doesn't exist in front of the enemy. So when it finds a gap, it stops moving. You can do the same to stop it if there's a wall in the way. Just check if there is a tile in the way.
I'll work with this information and see where I can get, thank you.