PDA

View Full Version : Life aspect in tile based game


acurtiz
03-29-2005, 04:50 PM
Hello everyone. I am making a game, it can be found at www.ancientagame.tk

I want to make it similar to maybe a Zelda game, and to do that I have to include life. The version with enemies isn't on that site, but I do have it. I followed the OOS Moxiecode Outside of Society tutorials, and also the Tonypa's tutorials. Heres what I have for what it does when you are hit.

ob.life = -1;
if (ob.life = 0;){
removeMovieClip(_root.tiles);
gotoAndPlay(4);

I defined the characters life at the beggining of the script. I want to make it so when the life reaches 0 the game goes to a you died screen, which is frame 4. The ob.life = -1; is what i used to decrease a life when you are hit. I have a strange feeling this won't work. Any help?

[Sx]
03-29-2005, 05:08 PM
change:

ob.life = -1;

to:

ob.life -= 1;

hope it helps...