Log inGet started
World

First Light: Betocsin

Branchmain
Branchesmain
Commit065ea629bf

README.md

Warden

The rules of First Light: Betocsin. One instance, mounted on mount_game by the scene. It owns the round — the phase machine, the crane, the drop, the trim, the dawn clock, the hoist, the ring and the two ways to lose — writes game.core's state, and emits every event that file lists under "rules". It draws nothing, plays no sound and moves no camera.

The round

title ──start──▶ opening ──staged──▶ stacking ⇄ paused
                                        │
                           course 24 ───┴──▶ hoist ──staged──▶ ring
                                        │                       │
                   collapse / sunrise ──▶ lost              press ▶ won
  • stacking — a course hangs from the crane and slides back and forth along one lozenge edge: U on odd courses, V on even. drop lets it go, it falls for FALL_TIME, and what it overlaps with the course below is what survives.
  • the trim — a course is a parallelogram spanned by a along Core.U and b along Core.V, centred at (cu, cv). Two courses share those edge directions, so their overlap is the intersection of the two u-intervals crossed with the intersection of the two v-intervals: a miss of t along U leaves a - |t| re-centred at cu + t/2, and the |t| beyond it becomes the offcut. The footprint stays a parallelogram forever, and the error alternates between the two edge pairs instead of eating one of them.
  • a perfect seat — a miss inside Core.PERFECT_TOLERANCE is not trimmed at all and the edge grows back by Core.PERFECT_REGROW, capped at the full lozenge. Perfect seats are what make course 24 reachable.
  • collapse — an edge trimmed under Core.MIN_EDGE cannot carry the next course. The round is lost, state.lastLoss reads "fell".
  • the night — state.dawn advances by dt / Core.NIGHT_SECONDS while stacking, and only while stacking. The first watch opens with the round and each boundary in Core.WATCHES opens the next, so there are four watches and four tocsin beats. dawn reaching 1 loses the round with state.lastLoss = "sunrise".
  • the ring — the hung bell swings on state.swing.t with an amplitude of state.swing.a / 2. Pressing drop rings it, and the quality handed to the ring event is how close to the top of the swing the press landed. No press within RING_WINDOW tolls it anyway, badly; there is no way to fail here.

What it reads from other slices

  • game.blocks.Blocks for every piece of geometry. spawnSlab, reshape, spawnOffcut and spawnPlinth are required; spawnCrane (with crane:setHang(cu, cv, y)) and spawnBell are asked for and skipped when they are not there. A hero-asset call that raises is logged, dropped for the rest of the round, and asked for again on the next one — so a fix lands without anything here being edited, and a broken call never takes the round with it or floods the log.
  • staged, emitted by the camera slice, releases the opening and hoist beats. Each carries a timeout (8 s and 6 s) so a beat that never answers cannot freeze the round.
  • ui, emitted by the screens slice — start, howto, back, resume, restart, pause. The screens slice says what the player asked for; this component decides what that means from where the round is, and is the only thing that sets a phase.

Controls

game.tower is activated when a round begins and stood down at the title and on both end cards, so the crane's buttons are on screen exactly while there is a course to drop. drop seats the course and, at the top, rings the bell; pause puts the pause card up and takes it down again. Both are bound for keyboard, gamepad and touch by the map, and this component subscribes to the control names only — never to a key. Activating a map hands back controls with no subscribers, so the handlers go on at every activation.

Nothing here reads the screen size: the rules are metres and seconds, and every shape shows the same round.