Contraption Builder: complete object/joint settings + sandbox upgrades#21
Merged
Merged
Conversation
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
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.
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/uprefixes, no reserved-word identifiers), and is append-only on disk so older saves still load.Commit 1 — Complete object & joint settings
Part inspector
b2kReshape, so joints survive.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
b2kMoveTo); build ramps and slopes.b2kSetGravity), saved with the scene.b2kStepOnceKit command plus Pause/Step buttons freeze the sim and advance one frame at a time.Customize & content
b2kSetVelocity/b2kSpin).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:
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