Browse Source

Keep Update() from advancing by very large chunks; use more double math

master
Colin McMillen 4 years ago
parent
commit
c08defc656
  1. 6
      Shared/SneakGame.cs

6
Shared/SneakGame.cs

@ -107,9 +107,11 @@ namespace SemiColinGames {
}
if (!paused) {
float modelTime = (float) gameTime.ElapsedGameTime.TotalSeconds;
double modelTime = gameTime.ElapsedGameTime.TotalSeconds;
// To prevent huge diffs, never update by more than 4 frames' worth of time.
modelTime = Math.Min(modelTime, TARGET_FRAME_TIME * 4.0f);
Clock.AddModelTime(modelTime);
world.Update(modelTime, input);
world.Update((float) modelTime, input);
}
base.Update(gameTime);

Loading…
Cancel
Save