Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Game.IsFixedTimeStep Property

Gets or sets a value indicating whether to use fixed time steps.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

public bool IsFixedTimeStep { get; set; }

Property Value

true if using fixed time steps; false otherwise.

The default value for IsFixedTimeStep is true.

A fixed-step Game tries to call its Update method on the fixed interval specified in TargetElapsedTime. Setting Game.IsFixedTimeStep to true causes a Game to use a fixed-step game loop. Using a fixed step allows game logic to use the update as its basic unit of time and assume that Update will be called at the interval specified. When an update runs slower than expected, Game meets this assumption by calling Update extra times and dropping the frames associated with those updates to catch up. This ensures that Update will have been called the expected number of times when the game loop catches up from a slow down.

When using a fixed-step game loop, rates such as the distance a sprite moves can be expressed as game units per Update. This enables you to simply increment the position of the sprite by the sprite's movement rate each Update.

Xbox 360, Windows XP SP2, Windows Vista

Show:
© 2015 Microsoft