What does this line do?
health -= damage;
- Reduce health by the damage amount
- Heal the player back up to full
- Respawn the defeated enemy now
- Pause the whole running game loop
It subtracts incoming damage from health.
Play Game Dev ▸
health -= damage;