Skip to content

Documentation / @debuffjp/core / Scene

Interface: Scene ​

Defined in: scene.ts:5

A scene owns a slice of game state. Lifecycle: enter → (update/render)* → exit.

Properties ​

id ​

readonly id: string

Defined in: scene.ts:6

Methods ​

enter()? ​

optional enter(game): void

Defined in: scene.ts:7

Parameters ​

game ​

Game

Returns ​

void


exit()? ​

optional exit(game): void

Defined in: scene.ts:11

Parameters ​

game ​

Game

Returns ​

void


inspect()? ​

optional inspect(): unknown

Defined in: scene.ts:13

JSON-serialisable snapshot for dev tools and scenario assertions. Not called in production.

Returns ​

unknown


render()? ​

optional render(draw, alpha, game): void

Defined in: scene.ts:10

alpha is the fraction between the last and next simulation step, for interpolation.

Parameters ​

draw ​

Draw

alpha ​

number

game ​

Game

Returns ​

void


update()? ​

optional update(dt, game): void

Defined in: scene.ts:8

Parameters ​

dt ​

number

game ​

Game

Returns ​

void