How do you make one of many ennemies die after 5 shots

Talk about making games.

How do you make one of many ennemies die after 5 shots

Postby supaboy86 » Thu Jan 26, 2006 1:11 pm

I am making a Metroid Prime type game and I don't know how to kill an enemy by shooting it by a certain number of times. Need serious help!
supaboy86
 
Posts: 11
Joined: Fri Jan 14, 2005 2:43 am
Score: 0 Give a positive score

Email me @ badboi06@aol.com please

Postby supaboy86 » Thu Jan 26, 2006 2:15 pm

my computer takes too long to come to this site. Thank you.
supaboy86
 
Posts: 11
Joined: Fri Jan 14, 2005 2:43 am
Score: 0 Give a positive score

Postby Novice » Thu Jan 26, 2006 6:50 pm

Make an actor integer varable called enemyHealth.
On create enemy enemyHealth=5;
On enemy collision with bullet enemyHealth--;
On draw enemy
Code: Select all
if (enemyHealth<=0) DestroyActor("Event Actor");

Later you can just create clones of this enemy and every one will have its own health. If any of these terms are unclear check out the tutorials, the forum search or GE documentation, but feel free to ask any questions thats why we are here. Hope this helps.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Game A Gogo » Thu Jan 26, 2006 8:41 pm

and remenber to not put the integer to global.
or, when you shoot an enemy the enemy healt will go down too.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest