skoppe / spasm

Write single page applications in D that compile to webassembly
MIT License
218 stars 17 forks source link

Delta time should be capped #58

Open silverweed opened 3 years ago

silverweed commented 3 years ago

I tried the "underrun" example on browser and my PC had a couple of hiccups since I was compiling some code in the meantime. Every time this happens the character gets "teleported" a long distance because the delta time between frames is never capped to a maximum amount, so it may grow huge when the browser freezes for more than a fraction of a second.

I'm not sure if this would be preferably done at the "engine" level (basically here) or if every game should decide what's its delta time cap - I'd probably go with the first but there's no right answer here.