How To: Make a Game Use a Variable Time Step
The Complete Sample
The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.
To Make a Game Use a Variable Time Step
- Create a class that derives from Game.
Since the amount of time between calls to Update will vary, specify any rates used in the game as units per millisecond (ms).
Determine the change that occurred since the last update by multiplying any rates being used by the elapsed time.