Class: Mode

TankGame.Mode()

Class Mode that represents variable modes that the game engine can run. If there are any issues the game engine will switch to the default game mode which is the empty mode.

Constructor

new Mode()

An abstract class constructor that throws an error if it is instantiated.
Source:
See:
Throws:
Abstract class TankGame.Mode can't be instantiated
Type
Error

Methods

attachTo(gameEngine)

Attach the game engine to the mode. This allows the mode to pull data such as the frame rate, gravity, screen dimensions etc from the game engine.
Parameters:
Name Type Description
gameEngine TankGame.GameEngine The running game engine
Source:
Throws:
input param gameEngine is not instance of TankGame.GameEngine
Type
Error

draw()

An abstract method which needs to be overridden.
Source:
Throws:
Method 'draw()' must be implemented
Type
Error

shutdown()

An abstract method called when the mode is exited.
Source:

startup()

An abstract method called when teh mode is started after it is attached to the game engine
Source:

update()

An abstract method which needs to be overridden.
Source:
Throws:
Method 'update()' must be implemented
Type
Error

Documentation generated by JSDoc 4.0.2 on Wed Oct 29 2025 23:51:02 GMT-0700 (Pacific Daylight Time)