EndGate.Game

Description: Defines a virtual Game object that is meant to be derived from. Games contain a multitude of management objects to control every aspect of the game.

Implements: EndGate.IUpdateable , EndGate.IDisposable

Constructors

Game ()
Creates a new instance of the Game object. A default canvas will be created that fills the DOM body.

Game (gameCanvas)
Creates a new instance of the Game object.

gameCanvas: HTMLCanvasElement
The canvas to utilize as the game area.

Fields

Configuration: EndGate.GameConfiguration
The games configuration. Used to modify settings such as the game update rate.

CollisionManager: EndGate.Collision.CollisionManager
A collision manager which is used to actively detect collisions between monitored Collidable's.

Scene: EndGate.Rendering.Scene2d
A scene manager which is used to draw Graphic2d's onto the game screen.

Input: EndGate.Input.InputManager
An input manager which is used to monitor mouse and keyboard events.

Content: EndGate.Content.ContentManager
A content manager which is used to load, unload and retrieve images and audio sources.

Methods

LoadContent()
Triggered at the start of the game. All audio sources and images should be loaded in this method.

Update()
Triggered on a regular interval defined by the GameConfiguration.

Draw()
Triggered as fast as possible. Determined by the current browsers repaint rate.

Dispose()
Removes game canvas and disposes all tracked objects.

Examples

There's currently no example available for this page. If you'd like to suggest one send me an containing a description, code, and link to the page for the suggested example. As a thanks I'll associate the code snippet with your name directly below the example if approved.