Log inGet started
World

Night Mail — Sorting Tower Seven

Branchmain
Branchesmain
Commit1d31d2aac7

README.md

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

SurfaceWhat it is
nm.GRID, cellToWorld, worldToCell, inBounds, key, unkey, bandAtthe 9 × 24 lattice the tower is laid on
nm.DIRS, step, yawForrotation: 0 east, 1 north, 2 west, 3 south
nm.PALETTE, rgbbrass, bakelite, oiled steel, amber, cold shaft blue
nm.DISTRICTS, CLASSES, PARCEL_KINDS, REQUIREMENTS, parcelKind, districtwhat travels
nm.PARTS, part, PART_CATEGORIESthe municipal supply ledger
nm.SHIFTS, shiftDef, PILEUP_LIMIT, JAM_SECONDS, STARTING_PURSEthe six nights
nm.state, setPhase, paythe one live state table
nm.on, off, emit, sfx, EVENTSthe event bus — "this happened"
nm.api, callthe verb registry — "please do this"
nm.registerPartView, registerParcelView, registerFxView, buildPartView, buildParcelView, buildFxthe art seam
nm.cam, CAM, camApply, screenToWorld, screenToCell, focusthe orthographic cutaway camera
nm.ANCHORS, anchorthe eight scene anchors, one per slice
nm.money, clockText, lerpformatting

Notes

  • The bus, the api registry, the view registry, nm.state and nm.cam are all guarded with or so a hot reload of this file keeps the live instance: a handler another slice registered survives a save here.
  • nm.cam is written by the staging slice alone. Everyone else reads it, or asks for a move with nm.focus(x, y, height, seconds).
  • The full design, the slice split and the file ownership map are in /source/design/spec.md.