3 lifes - how?

Game Editor comments and discussion.

3 lifes - how?

Postby XXGamexGodXX » Tue Jul 17, 2007 3:41 am

I want to make the character have three lives and when he gets hit by the enemy he respawns back to the beginning....how can i accomplish this....please help
XXGamexGodXX
 
Posts: 5
Joined: Thu Jul 12, 2007 2:11 am
Score: 1 Give a positive score

Postby pixelpoop » Tue Jul 17, 2007 3:55 am

Select your player character
Click on: Add- Collision- Of Actor(enemy name) -Add Action-Script Editor
Click on: Variables -Add -name it something like character_lives.
In the script editor write:

character_lives+=1;
x=0;
y=0;
//change the zeros to equal the x and y positions for the starting point
if (character_lives==3){ DestroyActor("Event Actor"); character_lives=0;}
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby XXGamexGodXX » Tue Jul 17, 2007 4:04 am

okay....but what i have characters (the lives) and i want them to dissapear one by one eery time he dies..so if he dies...then the first life will be gone...and then if he dies again..then the second life will be gone...and when he dies the third time the third life goes away and then it says game over...could you help me with that?
XXGamexGodXX
 
Posts: 5
Joined: Thu Jul 12, 2007 2:11 am
Score: 1 Give a positive score

Postby pixelpoop » Tue Jul 17, 2007 9:35 am

make 3 files all the same size with the lives icons lined up. Name the first file something like lives_icons_00.png and delete all but one of the icons out of it. Now in the second file delete just one of the 3 icons and name it lives_icons_01.png
Now name the 3rd file lives_icons_02.png and leave all the icons in it.
Now add a new actor to the game and name it lives_icon, now add the 3 files as its animations.
Now add an Event:-Create Actor -Script editor
Click on:variables/functions -Change animation -Stopped
Now copy paste this below the line you just created: animpos=2;

Now replace the first script I gave you with this:
lives_icon.animpos-=1;
x=0;
y=0;
//change the zeros to equal the x and y positions for the starting point
if (character_lives==3){ DestroyActor("lives_icon"); character_lives=0; DestroyActor("Event Actor"); }
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby arcreamer » Thu Jul 26, 2007 2:15 am

um ... WHAT? i did everything u said except that part at the bottom where u said copy and paste the below line u created... um, it threw me off cause i deleted hat i had and pasted it and then it got all screwed and now im lost =(((
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:57 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.

http://game-editor.com/forum/viewtopic. ... 3041#23041
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron