To render a game for the browser use the
game: Your Top-Level Game Sprite called with its props passed in, e.g.
options: An object with the following properties:
loadingTextures: (Optional) An array of textures to show while the game is loading.
assets: (Optional) An object containing image and audio file names to load.
dimensions: (Optional) A string that is either:
"game-coords": (default) Use the game coordinates as pixels in the browser.
"scale-up": Scales the game so that it fills up the browser window.
nativeSpriteMap: (Optional) A map of Native Sprite names and their web implementation.
canvas: (Optional) A canvas element to render to. If omitted, Replay will create a canvas in the document.
windowSize: (Optional) An object with width and height fields. Use to override the view size, instead of using the window size.
This can be used by Replay Test, see the docs there for more info.
device.inputs parameter of Sprite methods is of type:
The keys of
KeysPressed are based on the
key value of browser keyboard events. See keycode.info for values of
justPressed is only
true for one frame after an input is pressed,
justReleased for one frame after an input is released.