I have some code that looks like this:
if there is a collision between player and enemy
player.health--
I want to do this:
if there is a collision between player and enemy
player.health--
wait for 3 seconds
This is to ignore collision for a bit so player’s health doesn’t instantly drop to 0.
How would I implement some sort of timer for this?
to not freeze the movement you would have to either start a new Thread like this
or maybe simpler save the time the player was hit.