public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { if (!coveredByOtherScreen && !otherScreenHasFocus) { // variable time step but never less then 30 Hz World.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f))); } else { World.Step(0f); } Camera.Update(gameTime); base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { if (frameRateCounter != null) { frameRateCounter.Update(gameTime); } if (!coveredByOtherScreen && !otherScreenHasFocus) { // variable time step but never less then 30 Hz //World.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalMilliseconds * 0.001f, (1f / 30f))); World.Step(1f / 30f); } else { World.Step(0f); } Camera.Update(gameTime); base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); }