jonoxia / platform-game

untitled HTML 5 side-scroller
15 stars 5 forks source link

Animation is choppy #25

Closed jonoxia closed 13 years ago

jonoxia commented 13 years ago

Try requestAnimationFrame?

jonoxia commented 13 years ago

https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame

jonoxia commented 13 years ago

https://github.com/jonoxia/platform-game/commit/060654c7c82ef6acc898dfe274a2da7dcedff91e

now using requestAnimationFrame (thanks to Paul Irish's cross-browser method) and handling variable elapsed time between updates. Animation still freezes a bit once in a while (when garbage collector runs?) but that's a different bug.