My game is a platformer where the goal is to get to a door that appears and reappears. While trying to find it, there are enemies which fire at the player. I know how to do the whole projectile thing but I don't want my player to die unless he has little health left. Help?
Give your Character Sprite a variable 'Health' and set its initial value to 100, or whatever you like
On 'Projectile' collision with 'Character Sprite' > Subtract X amount from 'Health' Variable
You can also Destroy the projectile in this event.
Hope it helps!
Develop games in your browser. Powerful, performant & highly capable.
Oh yeah and i forgot,
When 'Health' is equal or less than 0 > Destroy 'Character Sprite'
Thanks Frostein, but how do I make a textbox display how much health I have?