Game:

events: KEventHandler<GameEventMap & GameObjEventMap>

Where game object global events are stored.

root: GameObj<TimerComp>

The root game object, parent of all game objects.

gravity: Vec2 | null

The gravity vector of the game.

scenes: Record<SceneName, SceneDef>

The scenes of the game.

currentScene: string | null

The current scene of the game.

layers: string[] | null

The layers of the game.

systems: System[]

All systems added to the game.

systemsByEvent: [ System[], System[], System[], System[], System[], System[] ]

The systems added to the game, sorted by event.

defRNG: RNG

The default RNG used by rng functions.

crashed: boolean

If game just crashed.

areaCount: number

How many areas are in the game.

fakeMouse: GameObj | null

Fake Mouse game obj.

warned: Set<string>

Deprecated functions we already warned about.

The "Game" it's all the state related to the game running

kaplay logo

Misc

Layer