▣
module · drop-in viewer
nm_core
The shared contract for **NIGHT MAIL — Sorting Tower Seven**.
by·posted 2mo ago
What it does
nm_core
The shared contract for NIGHT MAIL — Sorting Tower Seven.
local nm = require("nm.nm_core")
Every slice of the game requires this module and nothing else of each other's.
It is read-only to build slices — put your own constants in your own module,
publish verbs on nm.api, announce things on the bus.
What is in it
| Surface | What it is |
|---|---|
nm.GRID, cellToWorld, worldToCell, inBounds, key, unkey, bandAt | the 9 × 24 lattice the tower is laid on |
nm.DIRS, step, yawFor | rotation: 0 east, 1 north, 2 west, 3 south |
nm.PALETTE, rgb | brass, bakelite, oiled steel, amber, cold shaft blue |
nm.DISTRICTS, CLASSES, PARCEL_KINDS, REQUIREMENTS, parcelKind, district | what travels |
nm.PARTS, part, PART_CATEGORIES | the municipal supply ledger |
nm.SHIFTS, shiftDef, PILEUP_LIMIT, JAM_SECONDS, STARTING_PURSE | the six nights |
nm.state, setPhase, pay | the one live state table |
nm.on, off, emit, sfx, EVENTS | the event bus — "this happened" |
nm.api, call | the verb registry — "please do this" |
nm.registerPartView, registerParcelView, registerFxView, buildPartView, buildParcelView, buildFx | the art seam |
nm.cam, CAM, camApply, screenToWorld, screenToCell, focus | the orthographic cutaway camera |
nm.ANCHORS, anchor | the eight scene anchors, one per slice |
nm.money, clockText, lerp | formatting |
Notes
- The bus, the api registry, the view registry,
nm.stateandnm.camare all guarded withorso a hot reload of this file keeps the live instance: a handler another slice registered survives a save here. nm.camis written by the staging slice alone. Everyone else reads it, or asks for a move withnm.focus(x, y, height, seconds).- The full design, the slice split and the file ownership map are in
/source/design/spec.md.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.