groundY(row: number) → number
The floor height of a terrace row: row ROWS is at 0, each row uphill
is STEP_Y higher, the shrine terrace (row 0) highest of all.
| arg | type | description |
|---|
| row | number | |
rowAtZ(z: number) → number
The row whose terrace covers world z, clamped to [SHRINE_ROW, VALLEY_ROW].
| arg | type | description |
|---|
| z | number | |
colAtX(x: number) → number
The column whose plot covers world x, clamped to [1, COLS].
| arg | type | description |
|---|
| x | number | |
rowZ(row: number) → void
The z-range of a terrace row: the near (uphill) edge and the far
(downhill) edge. Row 0 is the shrine terrace, ending at Z_ORIGIN.
| arg | type | description |
|---|
| row | number | |
plotCenter(col: number, row: number) → void
World-space centre of a plot's soil (the path strip sits uphill of it,
between the plot and the camera).
| arg | type | description |
|---|
| col | number | |
| row | number | |
pathCenter(col: number, row: number) → void
World-space centre of the path strip in front of a plot — where the
Facer stands to work it.
| arg | type | description |
|---|
| col | number | |
| row | number | |
floorAt(x: number, z: number) → number
Floor height under any (x, z): the terrace's floor, the shrine terrace,
or the valley.
| arg | type | description |
|---|
| x | number | |
| z | number | |
shrineCenter( ) → void
World-space centre of the shrine, on its own terrace above row 1.
resetState( ) → void
Reset the shared state to the start of a run.
sunHeightFor(phase: string, t: number) → number
The sun's height for a phase and the time into it: -1 below, 0 on the
horizon, 1 overhead. Every slice that lights, shades or times itself off
the sun reads this one function so they agree.
| arg | type | description |
|---|
| phase | string | |
| t | number | |
on(name: string, fn: (...any) → void
| arg | type | description |
|---|
| name | string | |
| fn | (...any | |
emit(name: string, ...: any) → void
| arg | type | description |
|---|
| name | string | |
| ... | any | |
clear( ) → void
Drop every listener. The scene calls this on unload so a reload does not
stack handlers.
sz(fraction: number) → number
One UI unit, read live, so every size in every screen scales with the
frame in both orientations.
It is a fraction of the shorter screen edge — EXCEPT that no unit may be
so large that the tallest screen overflows the frame. On a portrait frame
the shorter edge is the width and the height has room to spare, so the
short edge binds. On a landscape frame the shorter edge IS the height, and
a card 1.4 units tall could then never fit inside it: the title card came
out 812 points tall in a 720-point frame and was cut off at both ends. The
cap is what makes one set of proportions hold at every shape.
| arg | type | description |
|---|
| fraction | number | |
isPortrait( ) → boolean
True when the screen is taller than it is wide — the filmed shape.