How do I make lives have a running count between levels?

hhgoalhhgoal Member Posts: 2
edited November -1 in Working with GS (Mac)
Right now in my game there are 5 lives at stage 1. If you lose a life in stage 1 it shows up by deleting a heart from the 5 now leaving you with 4 lives.

However, when you advance to the next stage with 4,3,2, or 1 lives it resets and gives you 5 lives again.

Is there any way to make it so the lives are a running count between stages?

Thanks in advance!

Comments

  • youngster9youngster9 Member Posts: 326
    Make a global attribute as to how many lives are left. Then add a rule to each heart that when this attribute is below a certain number it should disappear you can do this by changing opacity or destroying it.

    Hope this helps
  • hhgoalhhgoal Member Posts: 2
    Thank you for responding,

    Right now I am using a "replicate" to make the hearts are you saying that I should change the hearts to individual actors then make a counter-like thing that destroys the hearts when it gets lower?

    Sorry for my confusion but I am sort of new at the gamesalad terminology.
  • hotMagichotMagic Member, PRO Posts: 266
    You could have individual actors, or you could have several images that contain the whole heart meter image, one contains one heart and two "blanks", one contains two, etc. The combined method makes it easier to line them up.

    The alternative is to have one heart image and just place it in the proper location, and as you said above, drawn them based on your variable number. I think the combined method is easier, personally.

    Just have one variable called life. If life ==0 you're character is dead. If 1, draw heart 1, if 2, draw heart 2, and so on.
  • fzeedfzeed Member Posts: 247
    Your variable that tracks life, needs to be made in the GAME attribute section, not the scene attribute section. Also, make sure that when you change scenes you dont have code that automatically changes the lifes back to the starting amount....Check out tsb video on creating a lifebar.
Sign In or Register to comment.