Rules
The referee of FIRST LIGHT: NEARSIDE. One instance, on `mount_rules`.
Rules
The referee of FIRST LIGHT: NEARSIDE. One instance, on mount_rules.
It owns everything about a run that is not the rover's own motion — how far
north the dawn line has crawled, how hot or cold the crate of saplings has
become, how much xylidine is in the tank, and whether the run is still going —
and publishes all of it as the rules surface.
local NS = require("game.ns")
local L = NS.get("rules").ledger()
L.band -- "hot" | "warm" | "dusk" | "cold"
L.temp -- -1 frozen .. +1 cooked, 0 comfortable
L.dz -- metres between the rover and the dawn line
L.progress -- 0 at the pad, 1 at the airlock
The race
The dawn line advances north at terminatorSpeed whatever the rover does, and
that is the whole game. NS.bandAt(roverZ - terminatorZ) says where the rover
stands relative to it: south of the line and inside NS.DAWN.hotBehind is the
copper band the saplings live in; further south is risen sun and the cargo
cooks; north of the line is earthlit night and it freezes. Stand still and the
line runs away north, full daylight arrives, and the run is lost in about
eleven seconds.
The route is NS.ROUTE.finishZ long and the line covers it in a little under
two minutes, so a driver who holds the band arrives with the cargo alive.
Surface
| Call | What it answers |
|---|---|
ledger() | Everything about the run this frame — phase, elapsed, fuel, temp, band, light, terminatorZ, the rover's pose, progress, cans, hops, cargo condition, result |
terminatorZ() | Where the dawn line stands, in metres north |
rover() | The rover's pose: x, y, z, heading, speed, grounded, hopping, stalled |
start() | Begin a run — resets the board and moves the phase to playing |
restart() | Reset the board and leave the phase alone |
resetToken() | Changes on every reset; RoverDrive watches it to put the rover back on the pad |
spendHop() | Take one hop's xylidine, or answer false and spend nothing |
creditCan(id) | Book a can the rover drove over: refills the tank, counts toward the ledger |
reportRover(pose) | RoverDrive publishes the pose it moved the body to this frame |
Events it fires
band when the rover crosses between bands, fuelEmpty when the tank drops
below one hop, won at the airlock and lost when the cargo reaches either
end of its range. It also drives NS.tick.
Fields
| Field | Default | Meaning |
|---|---|---|
autoStart | true | Walk title → intro → playing without help when the screens and staging slices are absent, so the loop is playable on its own. Once those slices publish their surfaces it never fires. |
terminatorSpeed | 7 | Metres per second the dawn line crawls north |
debugLog | false | Print a line on every band change and at the end of a run |
Scoped to this part · feeds back into the world's score.