I’m fairly new to using Python, and I’m trying to get a hit timer so that in my game when my player is hit, it needs to wait a couple seconds before he can be hit again.
I thought I could just do something like:
while hitTimer > 0:
hitTimer -= 1
and being hit resets the counter to 10, and requiring the counter to be > 0 to be able to be hit again, but it goes way to fast.
I tried using very small numbers like -= .00005 but that just makes my program lag bad.
How can I make it so it takes away 1 per second or something like that?
Thanks for any help.
In order to check for exactly 10 seconds, do this: