Game.Update Method

Called when the game has determined that game logic needs to be processed. Override this method with game-specific logic.

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

Syntax

protected virtual void Update (
         GameTime gameTime
)

Parameters

  • gameTime
    Time passed since the last call to Update.

Remarks

Update and Draw are called at different rates depending on whether IsFixedTimeStep is true or false. If IsFixedTimeStep is false, Update and Draw will be called sequentially as often as possible. If IsFixedTimeStep is true, Update will be called at the interval specified in TargetElapsedTime, while Draw will continue to be called as often as possible. For more information on fixed-step and variable-step game loops, see Application Model Overview.

See Also

Tasks

How to: Make a Game Use a Variable Time Step
How to: Make a Game Time Out
How to: Script the Camera to Follow a Curve

Concepts

Application Model Overview

Reference

Game Class
Game Members
Microsoft.Xna.Framework Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista