Is there a solution for HTML5 canvas animation stutter?

前端 未结 2 1868
失恋的感觉
失恋的感觉 2021-01-16 11:14

I am working on a HTML5 canvas animation (to be more precisely a photo slideshow). So far all my slideshows are in flash because last time (March 2010) I looked ihe framerat

2条回答
  •  难免孤独
    2021-01-16 11:55

    I'm currently working on a HTML5 BomberMan-clone and at first I tried to make some best-implementations of JavaScript gameLoops (google), but in the end I ended with a simple setTimeout(...) gameLoop :).

    And as it seems it's working quite nicely and smooth. I have still lots of work to do, but you can see the current-dev-version (setTimeout is set for 30 FPS - but if I set it to 60 FPS - no problems at all) here:

    (and thanks Simon for your drawing-optimizations comments all the time here on StackOverflow)

    http://sabiland.net/Testing/BomberMan_Dev/BomberMan.aspx

提交回复
热议问题