#Celeste source code using float as timer

6 messages · Page 1 of 1 (latest)

versed ermine
#

The source code is filled with all kinds of timers, which are backed with a field of type float.
Duration each update, the field is decremented by Engine.DeltaTime, which is usually 1/60.
The timer is considered completed when its value <=0.
Won't there be a floating-point error? Like the timer is expected to be 0, but actually >0, so there will be a one-frame difference?

lusty berry
#

#code_modding may be more active

void anvil
#

at some point, Engine.DeltaTime is too small to jump to the next float value

versed ermine
versed ermine