Split The code is public; the app answers only to the crew.
A click shorter than a frame still fires: latch input edges instead of sampling them #13
Check · Review · Land · Live done — Landed and live in production.
new above
offline
Split The code is public; the app answers only to the crew.
Check · Review · Land · Live done — Landed and live in production.
A press now survives the gap between frames.
src/client/press.tsis a small headless latch: a down edge on a latched control (fire,jump,use,reload) is remembered until a simulation step has actually seen it, and it counts on that step and no other — so a tap that ends before the next frame still fires, a tap caught by a frame that runs eight 64 Hz steps is still one bullet, and a tap that lands in a frame running no steps waits for one that can spend it. Everything else (walk,duck,scope, the axes) stays level-triggered, read from what is held when the frame is taken.input.tsnow feeds edges to the latch instead of mutating a sharedInputon every event, and exposestake(steps)plusinputAt(frame, step);main.tscomputes the step count first, takes the latch once before the loop, and derives each step's input from it. The 120 mssetTimeoutworkaround inattachButtonsis gone — the touch buttons are plain down/up now and the latch does the work, which also fixes the two buttons the workaround never covered.Worth looking at:
src/client/press.test.ts— the pure-latch rules, plus three tests that drive the real simulation through the latch (one tap one bullet with both an automatic rifle and a semi-auto pistol, one tap on an eight-step frame still one bullet, held fire keeps firing and a release stops it). Six of the eleven fail ifdownAtgoes back to sampling, four fail if the edge is repeated across every step, so both failure modes are pinned.bun test: 120 pass, 0 fail; bundle rebuilt and committed asstatic/app.baf3356f9f.js. I leftinput.tsitself untested — it still needs a DOM, and the README's list is updated to saypressis the tested part.🤖 Generated with Claude Code
Closes #9