Tag Info

New answers tagged

1

Any answer that doesn't link to Glenn Fielder's Fix Your Timestep article isn't an answer at all. So first, read that, because it more than addresses your problem. Note that you do not have to implement his ultimate solution in order to have a reasonably well behaved simulation. Yes, you can use a raw delta time, clamped or otherwise, as other answers have ...


1

This is how I do it in iOS games: // get's called approx every 60th of a second but not always - (void)drawViewLoop { timeThisRound = CFAbsoluteTimeGetCurrent(); deltaTimeThisRound = timeThisRound-lastTime; // don't let the delta get too big. Even if the fps slows way down cap delta at 1/20th of a second if (deltaTimeThisRound > 0.05) { ...


2

Well, I am not sure what language you use for your game so I'll explain it in C++, but you could use something called 'deltatime' Uint32 last = 0; Uint32 delay = 0; void loop() { Uint32 now = SLD_GetTicks(); if(now > last) { delay = now - last; last = now; } moveUp(delay); } void moveUp(Uint32 delay) { ...



Top 50 recent answers are included