Skip to main content

Function: createGame()

createGame(containerId): object

Defined in: utilities/create-game.ts:19

Creates a new game instance with the specified container ID.

Parameters​

containerId​

string

The ID of the container element where the game will be rendered.

Returns​

object

An object containing the game instance, ECS world, render context, time, and the resize sync keeping the render context's canvas sized to the container.

game​

game: Game

renderContext​

renderContext: RenderContext

resizeSync​

resizeSync: ContainerResizeSync

time​

time: Time

world​

world: EcsWorld