Skip to content

examples: polish the demo, contraption builder, and slingshot#75

Merged
SethMorrowSoftware merged 1 commit into
mainfrom
claude/youthful-euler-xwg28e
Jun 22, 2026
Merged

examples: polish the demo, contraption builder, and slingshot#75
SethMorrowSoftware merged 1 commit into
mainfrom
claude/youthful-euler-xwg28e

Conversation

@SethMorrowSoftware

Copy link
Copy Markdown
Owner

A safe-cosmetic polish pass over the three non-platformer example stacks, applying the lessons banked from the platformer. Three Opus reviewers combed each stack; this PR lands the high-confidence, statically-safe wins. Every change is example-side (outside the embedded Kit), passes tools/check-livecodescript.py + sync-embedded-kit.py --check, and is flagged for an OXT feel/look pass — none of it could be run here, so the runtime confirmation is yours.

Demo (box2dxt-demo)

  • Fixed a gotcha-11 landmine: hoisted the nested local tOldest in registerDrop to the handler top. A block-nested local can break OXT compilation, and the static checker doesn't catch it — this was a real latent risk.
  • Lidar fills the arena: spawn bounds now derive from gArenaL/R instead of hardcoded literals that clustered the bodies left-of-centre (the right strip was always empty).
  • Seeded the FPS readout so the first HUD frame isn't blank.

Contraption builder (box2dxt-contraption-builder)

Already playbook-clean — only two items:

  • Removed the dead partTabs function (a never-called near-duplicate of partTabsForInspector, ~30 lines).
  • tickHud reads the clock once per pass into a local (the "one clock read per pass" rule) instead of up to 4×.

Slingshot (box2dxt-slingshot)

The graphics-only game with the most visual headroom:

  • A built-once SKY BACKDROP (sky + horizon haze + sun + two rolling hills) — persistent decor created at the back of the chrome, left in place by sgWipeStage across level rebuilds, zero per-frame cost. Bumps kSgUIVersion 2 → 3 so older saved stacks rebuild once.
  • Aim-preview dots clamp to the turf instead of burying into the ground on low shots.
  • Star-rated level-clear cards (from leftover ammo) + a star flourish on the win card.

Deliberately deferred to your OXT pass (riskier / additive — not in this PR)

  • Demo: a boot/title overlay and hinge anchor-pegs (touch startup flow / z-order).
  • Contraption: pooling the spawnRing effect graphic (live render path).
  • Slingshot: pocket-dust on launch + banner fade-ins (more surface; the banner ramp needs its own generation guard), an ammo ●○ spent indicator (the loaded-shot count has a quirk I didn't want to risk blind), tower texturing, and screen-shake (b2kCamShake is a no-op without a camera).

Sky-backdrop note

The hill/sun rects are placed by calculation, not by eye — please confirm/tune their framing on the OXT pass. They're pure decor (no physics body), so worst case is a cosmetic nudge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KcQmrtT7Vun4pwnkvHbhxX


Generated by Claude Code

…ally verified)

A safe-cosmetic polish pass over the non-platformer example stacks, applying the
lessons banked from the platformer (build-once chrome, the performance playbook,
the OXT gotchas). All changes are example-side (outside the embedded Kit), pass
tools/check-livecodescript.py, and are flagged for an OXT feel/look pass.

Demo (box2dxt-demo):
- Fix a gotcha-11 landmine: hoist the nested `local tOldest` in registerDrop to
  the top of the handler (a block-nested local can break OXT compilation; the
  static checker does not catch it).
- Lidar scene now fills the whole arena (spawn bounds derived from gArenaL/R
  instead of hardcoded literals that clustered the bodies left-of-centre).
- Seed the FPS readout so the first HUD frame isn't blank.

Contraption builder (box2dxt-contraption-builder):
- Remove the dead `partTabs` function (a never-called near-duplicate of
  partTabsForInspector).
- tickHud reads `the milliseconds` once per pass into a local (the "one clock
  read per pass" rule) instead of up to four times.

Slingshot (box2dxt-slingshot):
- A built-once SKY BACKDROP (sky + horizon haze + sun + two hills), persistent
  decor behind every level, created at the back of the chrome and left in place by
  sgWipeStage; bumps kSgUIVersion 2 -> 3 so older saved stacks rebuild once.
- The aim-preview dots now clamp to the turf instead of burying into the ground.
- Star-rated level-clear cards (from leftover ammo) and a star flourish on the win
  card.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcQmrtT7Vun4pwnkvHbhxX
@SethMorrowSoftware SethMorrowSoftware marked this pull request as ready for review June 22, 2026 16:24
@SethMorrowSoftware SethMorrowSoftware merged commit 378e4a1 into main Jun 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants