1 decade ago by dominic
I just pushed a new version to the Git repo that uses
This should fix screen tearing issues and also prevents the game from running when it&
As this still a bit experimental right now, I'd love to hear your feedback! Does it work for you? And do you see any issues with not being able to specify a frame rate other than 60?
Update: Narf, after some more digging it turns out that for Firefox 4 using
I disabled it for Firefox. So Chrome 11 is now the only browser that&
window.requestAnimationFrame()
instead of window.setInterval()
in Firefox 4 and Chrome 11 for the main game loop.This should fix screen tearing issues and also prevents the game from running when it&
039;s not on the active tab. This also means that the #fps
parameter for ig.main()
is now completely ignored and will probably be removed in future versions. Impact will now always run at 60fps when possible.As this still a bit experimental right now, I'd love to hear your feedback! Does it work for you? And do you see any issues with not being able to specify a frame rate other than 60?
Update: Narf, after some more digging it turns out that for Firefox 4 using
requestAnimationFrame()
always results in a lower frame rate than setTimeout()
. See this bug. I disabled it for Firefox. So Chrome 11 is now the only browser that&
039;s not using the old #setTimeout()
way.