World

abstract class World(val bounds: SceneBounds)

The base of every game's state: the world owns its entities and nodes as plain properties, advances through update, and is drawn as root.

Immediate-mode: the game declares its state as ordinary vals, vars, and lists — an entity moves by rebinding (ball *= motion), leaves a list by removal — and scene projects whatever currently exists into draw order. Nothing is registered with the engine and nothing is retained between reads: root is recomputed from scene on every read.

Constructors

Link copied to clipboard
constructor(bounds: SceneBounds)

Builds the world around its fixed extent; the subclass's property initializers declare everything else.

Properties

Link copied to clipboard

The world's extent: the viewport scene carries as its bounds, fixed at construction.

Link copied to clipboard

The world drawn as a scene: scene's children under bounds.

Functions

Link copied to clipboard
context(step: Step)
abstract fun update()

Advances the world by one step.