examples: apply the transition-card lesson to the slingshot (+ demo cleanup)#73
Merged
Merged
Conversation
…leanup) Reviewed the other demo stacks against the lessons codified since they were written. The one clear lesson-gap was the slingshot: it had the platformer's "visible build seam" (and worse - it hid its overlay before tearing down), so every level change dismantled the old tower in view. - Slingshot: add a dedicated opaque transition cover (sgCard + sgCardText, kSgUIVersion 1->2) shown BEFORE each rebuild (all four transition callers: retry, next-level, win-replay, the 1-3 level jumps) and faded out after via a generation-guarded send-driven blendLevel ramp - the slingshot twin of the platformer's pfCardShow/pfCardReveal, minus the illustrated art. Kept separate from the translucent sgShade banner; the initial openCard build is left to the menu (a gSgCardActive gate). - Demo: remove the dead newStaticBar factory (defined, never called). The other stacks needed no change, and two agent-flagged items were false positives I verified and dropped: the contraption banner "10 Hz redundant relayout" actually shows 0.1s tenths (genuinely 10 Hz), and the demo's newPoly "wrong handle" already returns the control ref. The contraption per-frame loop is otherwise playbook-clean; spike-gamekit is self-declared throwaway scaffolding whose per-frame costs are intentional. Example-side only; no Kit touch, embedded Kit in sync. Static gates clean. The slingshot cover needs an OXT pass to confirm + tune the hold/fade timing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HkN9P6YodA65ZuhDDuuQks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
You asked me to review the other demo stacks and improve them with the lessons learned since they were written. I dispatched four review agents (demo, slingshot, spike-gamekit, contraption-builder), verified every finding against the actual code, and implemented only what held up.
The headline: the slingshot had the platformer's exact visible-build seam — and worse. Every level change ran
b2kClear/b2kTeardown/sgWipeStageon screen beforelock screen, and each transition path hid its translucent banner overlay right before tearing down, so the player watched the old tower dismantle against a bare card.Changes
Slingshot — a transition cover (the platformer's
pfCardShow/pfCardReveallesson, ported):sgCard+sgCardText(built once inbuildSgUI,kSgUIVersion1 → 2), raised above everything.sgCardShowcovers with aLEVEL n / 3title before the teardown — wired into all four transition callers (retry, next-level, win-replay, the1–3level jumps).sgCardRevealholds a beat then fades it out via a generation-guardedsend-drivenblendLevelramp.sgShadebanner so neither juggles the other's blendLevel; the initialopenCardbuild is left to the menu (agSgCardActivegate). No illustrated art — a plain tinted cover is enough here.Demo — removed the dead
newStaticBarfactory (defined, never called).What I deliberately did NOT change (and why)
Honesty matters more than a bigger diff — two agent-flagged "issues" were false positives I verified and dropped:
playElapsed()returns0.1stenths (format("%.1f", …)), so the value genuinely changes every 100 ms; gating it would be a no-op. Reverted.newPoly"returns the wrong handle" — it already doesreturn tRef(the control ref). No bug.The contraption-builder's per-frame loop is otherwise already playbook-clean (one-snapshot caching, sleep-skip, 4 Hz HUD, on-change FPS), and spike-gamekit is self-declared throwaway scaffolding (line 18: "not an example of Kit style") whose per-frame costs are intentional — it exists to measure them. Both left untouched on purpose.
Verification
python3 tools/check-livecodescript.py— all stacks clean, embedded Kit in sync.The slingshot cover needs an engine pass to confirm it masks the rebuild and to tune the hold (~600 ms) / fade timing — same as the platformer card did.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HkN9P6YodA65ZuhDDuuQks
Generated by Claude Code