lose life problem.

tollhousestudiotollhousestudio Member Posts: 166
edited November -1 in Working with GS (Mac)
I have a game where if you land on a certain part of the level, you lose a life.
This works fine but because the actor bounces, which I want to happen, you lose 2 or more lifes each time.

How would I make it that I only lose one life.

Comments

  • butterbeanbutterbean Member Posts: 4,315
    Create a global game attribute called: Player Life, and place a rule within the player that says: If actor collides with: (which part of the level you want them to lose a life, or heart), change attribute: Player.life to player.life-1

    Hope this helps!
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Create a global game attribute (Boolean) called "invincible".

    Only lose a life if invincible is false.

    Whenever your character loses a life, set invincible to true.
    Then start a timer for a second or two (or however long you want), which sets invincible back to false.

    At this time you could also do something graphically that shows the character is invincible like a glowing shield, or set its alpha to 50%, something like that. That same timer would reverse this as well when it ends.
Sign In or Register to comment.