When my warrior is hit, I want him to be immune for a couple seconds, so I save the timestamp of the last hit.
But the recent timetstamp is smaller than the previous one :eek:
(time( ) returns the number of seconds elapsed since 1970. It is an ever increasing number, or should be)
After a lot of mind boggling and not working, I Google about the function and find this :
time.time()
Return the time in seconds since the epoch as a floating point number. Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.
So what am I supposed to do now ? How can this be ?
BluePrintRandom, your solution is good, in fact I use it extensively when real time does not matter
(for example to shake the camera a little, or for a diamond to shine somewhat, etc).
I wanted something with time. But you are right, I will revert to a frame count solution, it is much simpler.