director
The run of The Hernsew Lingster: the phase the game is in, the tide coming into Yowe Fen, and the five hurdles that bar the causeway until their heron is answered.
run.director
The run of The Hernsew Lingster: the phase the game is in, the tide coming into Yowe Fen, and the five hurdles that bar the causeway until their heron is answered.
Attach one to the scene's Run anchor. It builds the hurdles as children of
that anchor and publishes everything else on the shared blackboard in
game.rules, so no other slice has to find it.
The phases
| phase | what it is | what leaves it |
|---|---|---|
title | waiting to be started | Run.begin(), or a UI_CLICK of "start"; failing that, autoStartSeconds |
opening | the staged arrival at the Low Staithe | Run.openingDone(), or openingSoloSeconds / openingMaxSeconds |
play | the walk up the causeway; the tide runs | the deck going under, the Fold, or an empty flock |
crest | the water is over the deck and the Fold is still ahead | the crest, or the Fold |
won | the High Fold, with at least one yowe | Run.restart() |
lost | the tide crested, or the last yowe was taken | Run.restart() |
What it publishes
On Rules.state, every frame: PHASE, TIDE_Y, TIDE_T, STATION.
As signals: PHASE(phase), TIDE_STEP(step) at each of the tide's ten
notches, and GATE_OPENED(stationId) when a hurdle stands aside.
It listens for ANSWERED(stationId, correct) — a wrong answer costs
Rules.TIDE.PENALTY_SECONDS of tide, a right one opens that post's gate and
moves the station on — and for YOWE_LOST and UI_CLICK.
Fields
autoStartSeconds— how longtitlewaits when no screens slice is there to press the button.openingSoloSeconds/openingMaxSeconds— how long the opening runs with and without a stage slice driving it.driveGreyboxWater— move the placeholder water plane fromTIDE_Ywhile the greybox fen is still what is on screen. Stops by itself once the real fen stands.gateOpenSeconds— how long a hurdle takes to swing aside.
Methods
begin() · openingDone() · restart() · phase() · tideT() ·
setTideT(t) (put the tide at a point of the run, for a staged beat or a
test) · answer(stationId, correct) · report() (the whole run as one
readable table).
Prefer require("run.state"), which wraps all of these and answers before the
component has awoken.
Scoped to this part · feeds back into the world's score.