To make enemies follow the player, I'm using "set bullet to angle(BoxWalker.x,BoxWalker.y,BoxPsi.x,BoxPsi.y)" How would I make it so an enemy would move to a certain position away from the character to use range attacks? Say I wanted the enemy to move to a position 600 pixels from the player? Any ideas? Thank you.
Could you do something like:
distance( enemy.x, enemy.y, player.x, player.y) < 600 set speed to 0
Or something of that nature...
My enemies will only fire in straight lines to I will need to get them to line up with the players Y. That is easy enough to do, I think, but I want them to also move a certain distance from the player--within range.
So is it possible that the enemies are too close to the player? And so would need to move away from the player to get into proper range? Or are they always going to be farther away and you just want them to move in to proper range?
Do you want diagonal movement for the enemies? Can they move to the player's Y, and then move up into range?
Develop games in your browser. Powerful, performant & highly capable.
Maybe use line of site, have them move toward the player, until the line of site is within range?
https://www.scirra.com/manual/163/line-of-sight
https://www.scirra.com/tutorials/474/pathfinding-with-line-of-sight