Skip to content

Contraption Builder: complete object/joint settings + sandbox upgrades#21

Merged
SethMorrowSoftware merged 2 commits into
mainfrom
claude/determined-brown-eKqMY
Jun 5, 2026
Merged

Contraption Builder: complete object/joint settings + sandbox upgrades#21
SethMorrowSoftware merged 2 commits into
mainfrom
claude/determined-brown-eKqMY

Conversation

@SethMorrowSoftware
Copy link
Copy Markdown
Owner

@SethMorrowSoftware SethMorrowSoftware commented Jun 5, 2026

Two commits. The first completes the per-object and per-joint settings; the second adds a batch of "compelling & customizable" sandbox features. Everything reuses existing Kit calls, follows the project's LiveCode conventions (p/t/g/k/u prefixes, no reserved-word identifiers), and is append-only on disk so older saves still load.

Commit 1 — Complete object & joint settings

Part inspector

  • Independent dimensions per shape: width/height (box, image, plate, anchor), length/thickness (capsule), diameter (ball, balloon, bomb), replacing the single blind "Size" scale. Re-fit on the same body via b2kReshape, so joints survive.
  • Exact numeric entry (click a value to type it) and +/− steppers, funneled through one setter.
  • New physics settings: linear/angular damping and bullet/CCD.
  • Settings grouped into tabs so the 8-row panel no longer overflows.

Per-joint inspector (new) — select a joint with the Drag tool to set motor (on/off + speed), limits (on/off + lo/hi), springs (Hz + damping), and rope min/max length, per joint kind.

Persistence — damping, bullet, and density now round-trip (density was previously lost on save and not copied by Duplicate), plus all joint settings.

Kit — added b2kMotorOff / b2kHingeLimitOff / b2kSliderMotorOff / b2kSliderLimitOff / b2kWheelMotorOff (existing wrappers only enabled features).

Commit 2 — Sandbox upgrades

Build & control

  • Part rotation — an Angle control on the Shape tab tilts box/image/capsule/poly/plate (b2kMoveTo); build ramps and slopes.
  • World gravity — a Gravity button cycles Normal / Low (moon) / Zero-G / Reverse / Sideways (b2kSetGravity), saved with the scene.
  • Pause / Step — a new b2kStepOnce Kit command plus Pause/Step buttons freeze the sim and advance one frame at a time.

Customize & content

  • Material presets — a Material control cycles Default / Ice / Rubber / Metal / Wood (friction + density + bounce together; label derived from current values).
  • Launch velocity & spin — a new Motion tab sets a per-part initial push (speed + angle) and spin, fired when Run starts (b2kSetVelocity / b2kSpin).
  • Adjustable motor power — the joint inspector exposes motor torque/force (was fixed) for hinge/slider/wheel.
  • Three new sample contraptions — Catapult, Newton's Cradle, Domino Run (the Domino Run also showcases the new Launch feature).

The part inspector now has four tabs: Shape / Physics / Motion / Special.

Verification

Static checks (LiveCode can't run in this environment): handler start/end balance is exact (336/336); every property key has matching cases across all dispatch functions; the busiest tab (Physics) is exactly the row cap; the new Kit command references valid Kit locals; all save fields are append-only.

Suggested manual test in LiveCode:

  1. Place a box → Shape tab: set Width/Height and Angle (tilt it); Physics: pick a Material preset and adjust damping/bullet; Motion: set Launch speed/angle/spin → Run, confirm it launches and spins.
  2. Gravity button → cycle to Zero-G / Reverse → Run; Save, reload → gravity restored.
  3. Pause mid-run, then Step repeatedly to inspect frame-by-frame; Pause again to resume.
  4. Build a hinge → Drag-select it → raise Motor power and speed → Run.
  5. Examples menu → Catapult, Newton's Cradle, Domino Run → Run each.
  6. Save a scene with angles/launch/materials/joint power, reload → all restored; load an old save → opens cleanly with defaults.

Out of scope / possible follow-ups: keyboard shortcuts, sleep-threshold control, a polygon point editor.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AyoQTVuyLtPMrR5oVW6FFr

claude added 2 commits June 5, 2026 00:00
Inspector:
- Set width/height (box, image, plate, anchor), length/thickness
  (capsule) and diameter (ball, balloon, bomb) independently, replacing
  the single blind "Size" scale. Polygons keep uniform scaling.
- Type an exact value by clicking any numeric setting; the +/- steppers
  still work. Both paths funnel through one setter so physics stays synced.
- Expose linear/angular damping (air drag) and the bullet/CCD flag.
- Organise settings into Shape / Physics / Special tabs so every kind
  fits without overflowing the 8-row panel.

Per-joint inspector (new):
- Select a joint with the Drag tool to edit its motor (on/off, speed),
  limits (on/off, low/high) and spring (hertz, damping), plus rope
  min/max length. Hinge/weld/rope/slider/wheel each show the relevant set.

Persistence:
- Save/load now round-trips part damping, bullet and density and the new
  joint settings. All fields are append-only, so older CB1/CB2 saves
  still load and fall back to defaults.

Kit:
- Add b2kMotorOff / b2kHingeLimitOff / b2kSliderMotorOff /
  b2kSliderLimitOff / b2kWheelMotorOff (existing wrappers only enabled
  features) in both the embedded and source Kit, documented in
  kit-reference.md.

No existing behaviour removed.

https://claude.ai/code/session_01AyoQTVuyLtPMrR5oVW6FFr
…ecipes

Seven sandbox upgrades that make the Contraption Builder more compelling
and customizable. All reuse existing Kit calls and follow the project's
LiveCode conventions; nothing existing is removed.

Build & control
- Part rotation: an Angle control on the Shape tab tilts box/image/
  capsule/poly/plate (via b2kMoveTo), so ramps and slopes are buildable.
- World gravity: a Gravity button cycles Normal / Low (moon) / Zero-G /
  Reverse / Sideways (b2kSetGravity); saved with the scene.
- Pause / Step: a new b2kStepOnce Kit command plus Pause/Step buttons
  freeze the sim and advance it one frame at a time.

Customize & content
- Material presets: a Material control cycles Default / Ice / Rubber /
  Metal / Wood, setting friction+density+bounce together (the label is
  derived from current values, so it stays correct after tweaks/reload).
- Launch velocity & spin: a new Motion tab sets a per-part initial push
  (speed + angle) and spin, fired when Run starts (b2kSetVelocity/b2kSpin).
- Adjustable motor power: the joint inspector now exposes motor
  torque/force (previously fixed) for hinge/slider/wheel.
- Three new sample contraptions: Catapult, Newton's Cradle, Domino Run.

The part inspector now has four tabs (Shape / Physics / Motion / Special).

Persistence: angle, launch speed/dir/spin, joint motor power and the world
gravity mode all round-trip; every field is append-only, so older CB1/CB2
saves still load and fall back to defaults.

Kit: b2kStepOnce added to the embedded and source Kit and documented.

https://claude.ai/code/session_01AyoQTVuyLtPMrR5oVW6FFr
@SethMorrowSoftware SethMorrowSoftware changed the title Complete object & joint settings in the Contraption Builder Contraption Builder: complete object/joint settings + sandbox upgrades Jun 5, 2026
@SethMorrowSoftware SethMorrowSoftware marked this pull request as ready for review June 5, 2026 00:43
@SethMorrowSoftware SethMorrowSoftware merged commit 6cf72f7 into main Jun 5, 2026
4 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