Set up the stage. This is the first step in starting a game.
The game-wide configuration object
The Id of the DOM element where the game exists
A function for building the first visible level of the game
Platform-specific features
Readonly accelerometeraccess to the the device's accelerometer
The background layers
Background color for the stage being drawn. Defaults to white
Readonly configThe game-wide configuration object
Readonly consoleA console device, for debug messages
Scaling ratio for fonts, relative to PPM4UF
The foreground layers
Background music that doesn't stop when the level changes
touch controller, providing gesture inputs
A heads-up display
Readonly imageA library of images
Readonly keyboardkeyboard controller, providing key event inputs
Everything related to music that is controlled on one level at a time
Readonly musicA library of sound and music files
Readonly networkNetwork interface
Optional overlayAny pause, win, or lose scene that supersedes the world and hud
The pixel-meter ratio (dummy value... gets computed early)
Readonly platformPlatform-specific features
Readonly rendererrendering support, for drawing to the screen
Readonly scoreThe Score, suitable for use throughout JetLag
The screen height (dummy value... gets computed early)
The screen width (dummy value... gets computed early)
Readonly storagePersistent storage + volatile storage for a game session and a level
The scaling ratio for SVG coords, relative to PPM4SVG
Readonly tiltThe tilt system for the stage
The physics world in which all actors exist
Request that an overlay be put on top of the game. This is not the HUD. It's something that goes on top of everything else, and prevents the game from playing, such as a pause scene, a win/lose scene, or a welcome scene.
Code for creating the overlay
Optional screenshot: ImageSpriteShould the overlay delay for a cycle or two, so a screenshot can be taken first?
Before we call programmer code to load a new stage, we call this to ensure that everything is in a clean state.
Stage is the container for all of the functionality for the playable portion of a game. Stage has several components:
Stage is effectively a singleton: On any transition from one stage to another in the game, we don't make a new Stage object... instead we clear out the existing one and reuse it.
Stage does not manage transitions between scenes on its own. Instead, it has mechanisms (onScreenChange and endLevel) for resetting itself at the beginning of a stage, and cleaning itself up at the end of a stage.