how do you make enemies attack?

Non-platform specific questions.

how do you make enemies attack?

Postby Goomba » Sun Sep 02, 2012 6:28 am

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...?
Batman can't be killed - setosorcerer
he can only be neutered... - ASFJerome
User avatar
Goomba
 
Posts: 220
Joined: Wed Apr 25, 2012 2:55 am
Location: Beyond time and space...
Score: 7 Give a positive score

Re: how do you make enemies attack?

Postby skydereign » Sun Sep 02, 2012 9:11 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron