Initialize Game object.
Width of the game screen.
Height of the game screen.
Whether or not to render with WebGL. Falls back to canvas.
Default is true.
The element to append the canvas to.
Default is document.body
Frames per second. Only updated if debug is true.
Updates per second. Only updated if debug is true.
An Assets instance for loading all game assets.
Whether or not to enable debug display (shows FPS and UPS).
Gets the canvas element used by the renderer.
Gets the height of the game screen.
Gets the current speed multiplier of the game.
Sets the speed multiplier of the game.
Gets the width of the game screen.
Start the game loop.
An update function to run for the game.
Whether or not to clear the canvas between each update.
Change to a new scene in the game.
The new scene to transition into.
Time in seconds for the transition.
Contains all aspects of a game.
Example
// This is a boring 'game'. const game = new Game(640, 480) game.run()