Open ghost opened 7 years ago
Currently, operations after stop().
stop()
With the proposed changes.
I took the liberty of adjusting the init/start/stop lifecycle and time handling in function of the rAF callback lifecycle.
context.dt
0
context.now
context.running
true
context.millis
context.st
.dt
I tried to match your coding style, but some air may be missing here and there. :) [1] Minus the last frame, which is a shortcoming that might need to be addressed.
Currently, operations after
stop()
.With the proposed changes.
I took the liberty of adjusting the init/start/stop lifecycle and time handling in function of the rAF callback lifecycle.
context.dt
is always0
because there is no previous framecontext.now
andcontext.dt
hold meaningful values only whencontext.running
istrue
context.millis
is the overall time spent in the animation loop [1] , not the context's lifetimecontext.st
(start time, in the spirit of.dt
) was added in order to easily determine the lifetime of the contextI tried to match your coding style, but some air may be missing here and there. :)
[1] Minus the last frame, which is a shortcoming that might need to be addressed.