andreaszdw Posted August 28, 2014 Share Posted August 28, 2014 Is the fps set to a precise amount? Must I move the sprites with an own calculated deltatime, or how do you do the timing in the games? Andreas Link to comment Share on other sites More sharing options...
lewster32 Posted August 28, 2014 Share Posted August 28, 2014 The game.time.elapsed property will give you the number of ms since the last frame. Link to comment Share on other sites More sharing options...
ZoomBox Posted August 28, 2014 Share Posted August 28, 2014 Is it OK if I calculate physics in the main update of my game ? Should I create my own loop ? I tried in the main update and I find it not very accurate. Link to comment Share on other sites More sharing options...
lewster32 Posted August 28, 2014 Share Posted August 28, 2014 Physics is calculated in several distinct phases during each frame; preUpdate is where the calculations happen and postUpdate is where they're applied to the sprites. In order to understand the execution order and where to change things it requires a bit of research and looking through the code, though it's all well laid out and the actual separation code isn't that complex, so it's well worth doing. Link to comment Share on other sites More sharing options...
ZoomBox Posted August 28, 2014 Share Posted August 28, 2014 Yep, I'm OK with this.I was talking about my own physic logic.Is the main update OK for this ? Link to comment Share on other sites More sharing options...
lewster32 Posted August 28, 2014 Share Posted August 28, 2014 That depends entirely on your implementation really. Link to comment Share on other sites More sharing options...
ZoomBox Posted August 28, 2014 Share Posted August 28, 2014 Hm OK, thank you Link to comment Share on other sites More sharing options...
Recommended Posts