Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by raphdamico

Hey all. Just started with Impact and am really impressed with it. Thanks Dom - It's a joy to work with!

I've read the documentation on the game loop / timer, and how it slows the game down if the framerate gets too low. This is awesome, except when trying a guitar hero style rhythm game.

Is it possible to override this behaviour to get a guaranteed synchronization with an outside track? I'm thinking something like http://themaninblue.com/writing/perspective/2011/05/12/

Cheers!
Raph

1 decade ago by dominic

By default, Impact slows the game down if the browser can&039;t render at least 20 frames per second - or more precisely: if one frame takes more than 0.05 seconds to render. You can set this 0.05 seconds limit to something higher (e.g. 10 seconds or JavaScript's #Infinity value) to ensure that the game won't slow down. See: ig.Timer.maxStep.

However, this might not be enough to keep everything synchronized to the music, as the browser could introduce some lag before playing the track. Syncing to the audio element&039;s #.currentTime however, should work in all cases. So if you&039;re using #ig.music, try syncing your game to ig.music.currentTrack.currentTime
Page 1 of 1
« first « previous next › last »