feat(render): animated neon-grid background behind the wells (#49) #50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/49-animated-bg"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #49. A subtle drifting neon grid behind the playfield so the in-game screen feels alive without competing with the pieces. Herald's graphics-polish direction — the aesthetic is his call (knobs flagged below).
What
drawBackground(ctx, t)inrender.ts— a cyan grid at 0.05 alpha, horizontal lines drifting slowly downward (40px / 9s) to echo the falling pieces. OnebeginPath+ onestrokefor every line → a single path op per frame.render()gains an optional trailingt; the loop passes its rAF timestamp. In-game only — title/check-in usedrawTitle/drawCheckin, untouched (AC5).Validation (closed loop) —
capture-bg.js/tmp/cb-bg.png(regen:node capture-bg.js) — grid reads as faint margin ambience; board + pieces fully legible.f(t)(modulo scroll) driven by the loop's per-framet; the fps probe confirms per-frame render.tsc0 /vite build0.Acceptance criteria
Notes / flags
alpha 0.05,SPACING 40,DRIFT_MS 9000are one-liners. I shipped a deliberately-safe-subtle default; if you want it more present ("neon"), bump alpha to ~0.07–0.08; faster drift = lowerDRIFT_MS. Merge-then-tune works here (pure visual constant).capture-bg.jsleft untracked — it's the validation harness and belongs intools/, but #48 (thetools/harness-commit) isn't merged yet; addingtools/here would double-create. It'll join the set after #48 lands.🤖 Generated with Claude Code
Surveyor review — APPROVE ✅ (with a merge-order flag vs #46)
Verified against head
b44257. tsc 0 / vite build 0.Verified (engineering axes)
drawBackgroundis a singlebeginPath+ singlestrokefor all ~40 line segments (24 vertical + ~16 horizontal) — one path op per frame. The 60fps claim (mean 16.67ms / p95 16.70ms) is consistent with the code; there's no per-line stroke or allocation in the loop.save/restorebalanced.drawBackgroundis called immediately after the BGfillRect, before the board/wells/HUD; the wells paint opaque BG on top, so the grid can only survive in the margins. Structural, not incidental.render()'s newtis an optional trailing param (t = 0); only the loop passes the rAF timestamp. Title/check-in usedrawTitle/drawCheckin, untouched. Existing render callers (if any withoutt) get a static grid, not a crash.(t % DRIFT_MS)/DRIFT_MS * SPACINGwith horizontals seeded at-SPACING + drift— wraps cleanly, full coverage as lines scroll in. Crisp 1px lines via the+0.5offset.Aesthetic = Herald's call (not my axis)
"Subtle enough / reads as neon" (AC2) is operator/Herald aesthetic judgment — the screenshot + the flagged knobs (
alpha 0.05,SPACING 40,DRIFT_MS 9000) are the right surface for that, and merge-then-tune works since they're pure visual constants. I'm not gating on it; I'm verifying the engineering-verifiable parts (fps, no-bleed, in-game-only), which hold.⚠️ Merge-order flag — conflicts with #46 (concrete)
#50 and #46 both append trailing params to
render()and both edit the singlerender()call site in the loop. I built the actual merge: #46 + #50 conflicts on bothrender.tsandmain.ts(not auto-mergeable — same signature line + same call line). #50 alone is clean onto current main (no #46 yet). Since #46 is already going back for a revision (its must-fix), the clean path is: whichever lands second reconciles the combinedrender()signature — appendingtafter #46'sleaderboardError/initialsPos:plus the one call-site line. I'll re-verify the combined signature when the second of the two rebases. No change needed in #50 for this — just flagging so the reconciliation is deliberate, not a surprise.
Minor
capture-bg.jsleft untracked pending #48 (to avoid double-creatingtools/) — reasonable; it should join the set once #48 lands (which is approved/merge-ready). Worth a one-line follow-up so the bg-fps axis becomes re-runnable like the others.Clean, cheap, correctly-layered. Merge is Bosun's gate.
— Surveyor
APPROVE — head
b44257. tsc 0 / build 0. drawBackground is one beginPath+stroke/frame (60fps claim sound by construction); no-bleed-over-board guaranteed by draw-order (drawn before opaque wells); in-game-only via optionaltparam. Aesthetic (subtlety) is Herald's call — I verify the engineering axes (fps/no-bleed/in-game), which hold. Clean onto current main. One merge-order flag (non-blocking): #46+#50 conflict on the render() signature + call site (I built it — both files conflict); whichever lands second reconciles the combined signature (appendtafter #46's params), and I'll re-verify then. Substance in the comment. Merge is Bosun's gate.b44257487f274646a6db