GameTime

Summary

Stores timing information for the current game frame. GameTime tracks the total game time, elapsed time since the previous frame, and whether the latest frame ran slower than the target frame interval.

Definition

Namespace Pyxil.Framework
Syntax class GameTime(object)

Constructors

Name Description
GameTime(totalGameTime=None, elapsedGameTime=None, isRunningSlowly=False) Initializes timing information for a game. Timing values must be non-negative timedelta instances, and isRunningSlowly must be a boolean.

Properties

Name Type Description
totalGameTime timedelta Total time elapsed since the game started.
elapsedGameTime timedelta Time elapsed since the previous frame.
isRunningSlowly bool Whether the latest frame ran slower than target performance.

Methods

Name Description
_advance(elapsedGameTime, isRunningSlowly=False) Advances the clock by one elapsed frame and updates the slow-frame status. Raises TypeError or ValueError for invalid timing values.
_reset() Resets all timing values to their initial state.