Page 1 of 1

how do you make enemies attack?

PostPosted: Sun Sep 02, 2012 6:28 am
by Goomba
how do you make enemies attack? like how do you make them move then attack you? i know that i would use paths for enemies pacing but then what...?

Re: how do you make enemies attack?

PostPosted: Sun Sep 02, 2012 9:11 am
by skydereign
I actually wouldn't recommending using paths for movement. Instead it is usually better to set xvelocity via timers, collisions, or in the draw event. To make an enemy attack (depends on how you are handling movement), you check if the enemy is in attacking range of the player, and change its animation. You'd also want to set an actor variable telling the game the enemy is attacking, which the player can use in a collision event to determine if the collision event was an attack.