Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
The overlay becomes engine: 2D drawing tools behind the door, and the range draws through them #60
Check · Review · Land · Live done — Landed and live in production.
`src/engine/overlay.ts` takes the generic half of both games' 2D behind the door: `Paint` — the range's structural target widened by the five members the shooter's HUD also names (`textAlign`, `globalAlpha`, `arc`, `rect`, `fill`), still structural, so a recording stub is one and a real context fits without a cast — and `overlay(paint, width, height)`, which builds the tools once per resize and al…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/engine/overlay.tstakes the generic half of both games' 2D behind the door:Paint— the range's structural target widened by the five members the shooter's HUD also names (textAlign,globalAlpha,arc,rect,fill), still structural, so a recording stub is one and a real context fits without a cast — andoverlay(paint, width, height), which builds the tools once per resize and allocates nothing per call:scale(width / 1280clamped to 0.7–1.4, which issrc/client/hud.ts's clamp to the number, with a comment saying so),pad,font,panel,text(align, font, fill, alpha, andglobalAlphaback at 1 whatever happened),crosshair,bar,columnsandclock. Not one colour, team, phase or word from either game is in it;overlay.test.tschecks every one of those with no browser in the room.src/range/readout.tsis the consumer that proves it: its scrim, its eight lines and its crosshair go through the tools, and itsPaintis imported from the door and re-exported somain.tsand its tests keep the name. The readout's own tests pass unchanged. Two small behaviour notes worth a look: the crosshair strokes each arm from its outer end in to the gap (so a gap of zero is the plain cross the range always drew, and the range's existing assertion about where an arm starts still holds), and the readout's margin is now the engine'spad, never under 12 px rather than 10 — the same number above 600 px wide, two pixels kinder below it.src/client/hud.tsis not opened here; that half stays #18, and when it moves it is a move, not a retune.bun testis green (392 pass) and both bundles are rebuilt and committed. The range is now 12,548 raw / 5,726 gzipped against its 12,800 / 5,800 ceiling — held, but with ~250 raw bytes left, because a tool set is bundled whole;scripts/build.tssays so and says the next range feature will want that ceiling raised. Two things landed in passing that were not mine to invent:boundary.test.ts'sSURFACEgains the three names (no new rule or exemption, just the pinned list), andGUIDE.md's quote ofsrc/client/main.tswas stale since #56 renamed the scene canvas — it was red on this branch's base and is fixed here. To try it:/rangein the preview — the panel, its numbers and the crosshair are drawn by the engine now and should look exactly as they did.🤖 Generated with Claude Code
Closes #49