help with creating lives system

app-etiteapp-etite Member Posts: 139
edited November -1 in Working with GS (Mac)
Hi Guys,

Sorry if this has been dealt with a lot before but i cant find much on it.

I could follow tshirtbooths tutorial on health bars, but what I want is...

3 lives displayed (hearts)... every time the character hits an object then a heart is deducted??

Also while im making progress on my game im realising that when i pause and replay the scene some things have not re-spawned or been put back to its initial state... how do I do that??

Thankyou

www.twitter.com/appetitegsames

www.facebook.com/pages/Appetite-Games/203583699676600

Comments

  • app-etiteapp-etite Member Posts: 139
    Nice one Tshirtbooth.

    But what rules do I place in if I want a heart to disappear each time my character hits and enemy?
  • app-etiteapp-etite Member Posts: 139
    somebody must have done this before right? : (
  • olster1olster1 Member Posts: 396
    Hey, I've never used a lives system before but my guess would be when your actor loses a life change attribute game.lives to game.lives -1

    Hope that helps
  • app-etiteapp-etite Member Posts: 139
    thanks olster

    but I tried that with no luck.. I have three lives formed from using a replicate behaviour. when I do game.lives-1 all three lives disappear.

    anymore ideas people?

    thanks
  • app-etiteapp-etite Member Posts: 139
    need serious help here guys. :( cant leave my game without lives!

    whats the best way to have 3 lives onscreen and have one deduct every time my character hits an enemy?
  • icanmakeicanmake Member Posts: 466
    i have this on my game. what i have is 3 different actors named life 1, life 2, and life 3. Then i have the attribute game.lives which is a real attribute with the default of 3. then on my player i have the rule when collide with enemy change attribute game.lives to game.lives-1 and the rule when attribute game.lives is 0 then destroy actor(or whatever you want to do. Animate, reset scene, etc.) on the actor life 3 i have the rule if attribute game.lives is 2 then destroy actor. similar rules apply for life 2 and 1. I do not know if this is the best way but it works for me. Also if you want the lives to follow your player moves on the screen then add them to an unscrollable layer. If you want more tutorials like this then subscribe to my youtube channel at youtube.com/user/partyrobot1. I hope this works for you.
  • rlehmrlehm Member Posts: 320
    click game, then + in attributes. Create what tshirt said, replicate, but make sure it replicates on the value of the game attribute (for example, the value it 3, you get the heart to replicate 3 times). After this, when you use game.lives to games.lives-1, when you die, you lose a heart. You then say, when game.lives = 0, destroy actor, or game over or what not
Sign In or Register to comment.