Type

Game

: {

gameObjLastId

: number

The last game object id used.

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.

defaultLayerIndex

: number

The default layer index 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.

defaultAssets

: {

ka

?: Asset<SpriteData>

boom

?: Asset<SpriteData>

burp

?: SoundData

happy

?: string

bean

?: string
}

logs

: Log[]

cam

: CamData

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<FakeMouseComp | PosComp> | null

Fake Mouse game obj.

allTextInputs

: Set<GameObj>

All text inputs in the game.

warned

: Set<string>

Deprecated functions we already warned about.

}

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

kaplay logo

Layer

Miscalenous