Top-Level Game
Your top-level Sprite is your Game
. It's a special Sprite that's called by the platform directly. All other Sprites are children of the Game
Sprite.
You define Game
(using makeSprite
) and its gameProps
separately:
- JavaScript
- TypeScript
The Game
Sprite requires two specific props, and some optional props (set in gameProps
):
- an
id
prop of value"Game"
- a
size
prop, see Game Size - (Optional) a
defaultFont
prop that applies to allt.text
Textures - (Optional) a
backgroundColor
prop, must be a CSS Level 1 color or 6 char hex (e.g.#ff0000
,green
)