Help with enemy health

Non-platform specific questions.

Help with enemy health

Postby Griffin Endurance » Tue Dec 26, 2006 10:25 pm

Hi

I have been working on a game in GE that use's the create actor feature to create multiple actors with the same property and i am at a bit of a loss. I would like to set it so if you weapon actor collides with one of the enemys 3 times it kills it. Im trying to do this within the enemy actors propertys so i can use the event actor bit so they dont all die. If anyones got any ideas i would be very greatful
Griffin Endurance
 
Posts: 10
Joined: Mon Dec 19, 2005 8:20 pm
Score: 0 Give a positive score

Postby Sgt. Sparky » Tue Dec 26, 2006 11:03 pm

I have a very simple Idea that should work, to do this easily. at the draw actor event of the enemy have this
Code: Select all
if (transp > .009)DestroyActor("EventActor");
and when the weapon collides with the enemy have this for the enemy
Code: Select all
 transp += .003;

and that should kill the enemy after 3 hits, to make a less amount of hits to do more damage increase the transp on the hit to a higher number :D
to kill in one hit have this on the collision
Code: Select all
 transp += 0.009;

I hope this helps :D :D :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Griffin Endurance » Wed Dec 27, 2006 11:37 am

Thanls that works great! thanks for the help
Griffin Endurance
 
Posts: 10
Joined: Mon Dec 19, 2005 8:20 pm
Score: 0 Give a positive score

Postby Sgt. Sparky » Tue Jan 02, 2007 3:42 pm

you are welcome! I used that for one of my games :D
Image
as you see the game is not that good so I did not finish it :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Tue Jan 02, 2007 10:29 pm

yeah, but this technique can change the transparency a little bit, and its not recommended to use on already partially transparent actor.
create an variable insted and change transp for the variable you created.
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

Postby irblinx » Tue Jan 02, 2007 11:26 pm

Isn't there a performance hit when using transparency settings?

Personally I'd use a local variable with the actor, each time your weapon hits the actor you could decrement the variable, once the variable reaches zero destroy the actor.

In the Actors "Create Actor" event
Code: Select all
actorLives = 3;


then in the collision event with the weapon;

Code: Select all
if (actorLives > 0){
   actorLives --;
}
else{
   DestroyActor("EventActor");
}
irblinx
http://www.irblinx.me.uk/Crania.htm
Current projects: Crania deluxe for Mac, iCrania
User avatar
irblinx
 
Posts: 122
Joined: Wed Apr 19, 2006 11:15 am
Location: Manchester, UK
Score: 6 Give a positive score

Postby Game A Gogo » Wed Jan 03, 2007 12:34 am

yes, transparency's affect game performance on slow machines a lot (I know! by experiance!)
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 General

Who is online

Users browsing this forum: No registered users and 1 guest