GameConfig is the object you pass when contructing a new Game.
• clearGrid? : undefined | false | true
Specifies whether 24a2 should clear the grid at the beginning of each frame. 24a2 clears the grid by setting the colour of every dot to GameConfig.defaultDotColor. Setting clearGrid to false lets you simplify the code for some games by letting 24a2 store the state for each dot. You can use Game.getDot to read back the colour of dots. By default, this is set to true.
• containerId? : undefined | string
The ID of a container to create the canvas in.
• create? : undefined | function
create(game) is a function which is called once, just before the game
starts running. You can use it to initialise game state, if needed.
• defaultDotColor? : Color
Set the default color of the dots. By default, this is set to Color.Gray.
• frameRate? : undefined | number
Sets the game’s frame rate. By default, this is set to 24.
• gridHeight? : undefined | number
Sets the height of the grid. By default, this is set to 24.
• gridWidth? : undefined | number
Sets the width of the grid. By default, this is set to 24.
• onDotClicked? : undefined | function
onDotClicked(x, y) is a function which is called when the player clicks
on a dot.
• onKeyPress? : undefined | function
onKeyPress(direction) is a function which is called when the player
presses one of the arrow keys.
• update? : undefined | function
update(game) is repeatedly called as the game runs. You can use it to
define the main functionality of your game.