The if(time.elapsed>1000) bit should not happen. If that was in the version I posted (I'm not seeing it on my copies), it was probably to prevent it from getting stuck for debugging something long ago.
The reason dt isn't reporting right is that you defined it as a member variable based on the timer, and the time between the timer starting and dt being defined is less than a millisecond. You'd want to define dt either when setting delay (if you want a fixed dt), or before restarting the timer (if it's based on the timer). I generally just define dt when calling the game's step/update/tick method, and pass it around from there.
The line wait((elapsed>=delay) ? 1 : delay-elapsed); uses the ternary operator. It's one of those things that isn't intuitive if you aren't familiar with it, but saves time when you are.
a= (b) ? c : d;
is the same as:
if (b) a=c
It's just a sort of shorthand.
_______________________________________________ Audiogames-reflector mailing list Audiogamesemail@example.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector