I'm doing a kind of plataform map, and now I need to make health (3 hearts, like Mario). I tried to do it with hittest but the hearts goes like crazy. Guess I need to make something like invulnerable or I don't know. What I want to do is three hearts, and, if the human touches a spike he loses a hearth.
Basically, it just has a variable called "invincible" that constantly counts down until it hits 0 (then it stays there until you set it to something else). It will only make you lose health if a collision is detected AND invincible==0. Then, once you lose 1 health, you set invincible to 15, so it won't trigger another hitTest for another 15 frames.