Making Lives

Non-platform specific questions.

Making Lives

Postby arcreamer » Thu Jul 26, 2007 12:44 am

hey im trying to make a life dissappear when i get hit so whats wrong with this code?

if (character_lives==2){ DestroyActor("Life1")} (character_lives=2);
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Postby d-soldier » Thu Jul 26, 2007 1:33 am

Where is that code being used? What actor/what event? Its a bit of a paradox really, as the character lives variable being "2" destroys an actor and then makes the varibale "2", which would cause it to do all this again, and again...

if (character_lives==2)
{
DestroyActor("Life1");
character_lives=2;
}
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby arcreamer » Thu Jul 26, 2007 1:38 am

i put it under the main player so when he gets hurt and his lives go from 3-2 then i want the Life3 actor to dissappear :P did i do it wrong? cause i dont understand scripting much yet =(
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Postby d-soldier » Thu Jul 26, 2007 2:29 am

I'm making a demo for you...
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby d-soldier » Thu Jul 26, 2007 2:58 am

Heres a demo, all you have to do is walk into the lasers and die, observing the "lives icons" deplete, then when none are left, game over. There are numerous ways to accomplish this within GE, this is merely one.
Attachments
livesdemo.zip
(25.34 KiB) Downloaded 151 times
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby arcreamer » Thu Jul 26, 2007 5:26 am

ok cool ill download it now
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Postby arcreamer » Thu Jul 26, 2007 5:30 am

how did u group 3 actors into one for the meter?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Postby DilloDude » Thu Jul 26, 2007 5:37 am

It is probably just one actor with an animation. The animation would go: 0 lives, 1 life, 2 lives, 3 lives through each frame. Or something like that.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby arcreamer » Thu Jul 26, 2007 5:43 am

lol check out my main menu! its an animation in the game just not in the pic but yeah the car is moving also! its awesome haha my first main menu and fun game! JET CHICKEN
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Postby arcreamer » Thu Jul 26, 2007 5:45 am

here it is
Attachments
scrnshot2.JPG
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest