Sets whether the game is paused. The game is still told to handle input, update itself and render. This is simply a flag that should be set whenever a "pause" screen is displayed. It stops the "in-game timer" until the game is unpaused.
Returns the length of time the game has been played so far. This is "playable time;" that is, time in which the user is playing, and the game is not paused or in a "not updating" state (such as the main frame not having focus).
Clears the screen.
The color to clear the screen with.
If unspecified, this.clearScreenColor
is used.
Returns a random number between 0
and
number
, exclusive.
The upper bound, exclusive.
The random number.
Resets the "playtime in milliseconds" timer back to 0
.
Starts the game loop.
Called during each tick to update game logic. The default implementation checks for a shortcut key to toggle the FPS display before delegating to the current game state. Subclasses can override, but typically update logic is handled by game states.
Generated using TypeDoc
A base class for a game.