lives count

Maniacus

  • Posts: 69
I have it set up so my character has 3 lives when created. Then when it hits the right side of another character it subtracts the lives by one. When i test it the lives go straight to 0. What am i doing wrong? Thanks

MichaelPel

  • *
  • Posts: 458
Well, the problem is probably that it repeats the action every single frame. So three frames pulls lives to what seems for you instantly to zero. I think, maybe

Maniacus

  • Posts: 69
yeah your right. Ive been messing with it and  still can't get it to work correctly.

Northfield82

  • Posts: 649
try setting a Boolean before hand, something like:

if right hand side hit
    if 'detract life' (Boolean) is False
          set 'detract life' to True
          set lives to lives - 1

then when the scene reload or whatever happens reset detract life to False

something along those lines anyway

TheIndieStation

  • *
  • Posts: 2263
Do it like this >>

If right hand side is hit
~If not Boolean
~~ Set Boolean to true
~~ Decrement health with 1
~~ Do after 1 seconds
~~~ Set Boolean to false

Good luck!

Maniacus

  • Posts: 69
It works perfect!!! thank you all for your help.