# How do I make the enemy of my videogame to move like this?

The enemies must follow the player direction and atack him with this V movement when they are very close to him just like the Bunby Helis from Megaman NES:

Probably something like,
Letâ€™s call them heli
At beginning, take their original y coordinate and assign it into an object number variable â€śoriginheightâ€ť.
Set a certain object boolean variable, say â€śvattackâ€ť to false.
If vattack is false,
Give them force to move horizontally towards the players x coordinate.
Check distance of player x coordinate and heli x coordinate if it is within a certain distance.
If close enough, switch â€śvattackâ€ť to true.
Get position of player(x and y this time), give heli force to move towards playerâ€™s position.
When position is reached, resume original force to move horizontally.
Check y coordinate against the variable originheight. If it is not equal, then give them force to move that way.
When heli y coordinate is close enough to originheight value, remove the movement force.
Set â€śvattackâ€ť to false and give new horizontal movement towards the player.
Rinse and repeat.

Maybe the return to â€śoriginheightâ€ť might need a boolean there as well, idk. But yeah, theoretically thatâ€™s how I imagine it would go.

2 Likes