diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index d593544..f3dc04a 100644 --- a/Shared/SneakGame.cs +++ b/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);