game/core.module — Luminaria's constants, light rules and run state.
Every slice requires this ("game.core") and nothing else of each other's.
It owns: colour masks, the beam tracer (pure, 2D in a chamber's local XZ
plane), the live puzzle state of the active chamber, player actions
(rotate / grab / reset), progression (solve -> descend -> win) and a tiny
event hub every slice listens on. It spawns nothing.
color(mask: number) → void
| arg | type | description |
|---|
| mask | number | |
isRotatable(d: ?) → boolean
levels( ) → void
Levels (owned by the chambers slice: game/levels.module)
chamberCount( ) → number return
def(k: number?) → void
| arg | type | description |
|---|
| k | number? | |
origin(k: number) → void
World position of chamber k's floor origin.
| arg | type | description |
|---|
| k | number | |
toWorld(k: number, x: number, z: number, y: number?) → void
| arg | type | description |
|---|
| k | number | |
| x | number | |
| z | number | |
| y | number? | |
toLocal(k: number, p: ?) → void
| arg | type | description |
|---|
| k | number | |
| p | ? | |
chamberAt(y: number) → number
Which chamber a world height belongs to.
| arg | type | description |
|---|
| y | number | |
dirOf(a: number) → void
Beam tracer (pure). def = a level table, st = { [id] = { rot, crystal } }
| arg | type | description |
|---|
| a | number | |
norm(a: number) → number
| arg | type | description |
|---|
| a | number | |
devRot(d: ?, st: ?) → number
filterMask(d: ?, st: ?) → number
hasCrystal(d: ?, st: ?) → boolean
trace(def: ?, st: ?) → void
| arg | type | description |
|---|
| def | ? | |
| st | ? | |
cast(x: ?, z: ?, ang: ?, mask: ?, src: ?, depth: ?, out: ?) → void
| arg | type | description |
|---|
| x | ? | |
| z | ? | |
| ang | ? | |
| mask | ? | |
| src | ? | |
| depth | ? | |
| out | ? | |
on(name: string, fn: (...any) → void
| arg | type | description |
|---|
| name | string | |
| fn | (...any | |
emit(name: string, ...: any) → void
| arg | type | description |
|---|
| name | string | |
| ... | any | |
freshDevState(k: number) → void
| arg | type | description |
|---|
| k | number | |
devState(k: number?) → void
| arg | type | description |
|---|
| k | number? | |
retrace(k: number?) → void
Trace the active chamber, emit receptor transitions and solve.
| arg | type | description |
|---|
| k | number? | |
nearest(pos: ?, filter: ((any) → void
Nearest device the Lightbearer can touch. pos = world position {x,y,z} or vec.
| arg | type | description |
|---|
| pos | ? | |
| filter | ((any | |
promptFor(pos: ?) → string
What a prompt should say for the device nearest pos (nil when none).
rotate(pos: ?, dir: number) → void
Rotate the nearest rotatable device. dir = +1 (E) or -1 (Q).
| arg | type | description |
|---|
| pos | ? | |
| dir | number | |
grab(pos: ?) → void
Take or place a lantern crystal at the nearest socket.
reset( ) → void
Restore the active chamber to its authored starting state.
body( ) → void
The local player's body. Set by the scene entrypoint's localPlayerReady;
falls back to finding the live PlayerAvatar if that hook ran before us.
spawnPoint(k: number) → void
Spawn point (world) of chamber k.
| arg | type | description |
|---|
| k | number | |
sealPoint(k: number) → void
Descent Seal centre (world) of chamber k.
| arg | type | description |
|---|
| k | number | |
descend( ) → void
Called by the Lightbearer when it stands on an open seal.
arrive(k: number) → void
Called (by the Lightbearer, after it has moved the body) once the player is in chamber k.
| arg | type | description |
|---|
| k | number | |