Skip to content

Commit 7ae24de

Browse files
Merge pull request #19 from SethMorrowSoftware/claude/youthful-galileo-D2uDO
Claude/youthful galileo d2u do
2 parents 6b0ad31 + c96189c commit 7ae24de

1 file changed

Lines changed: 51 additions & 41 deletions

File tree

examples/box2dxt-contraption-builder.livecodescript

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9149,8 +9149,8 @@ on buildRecipeBalloonLift
91499149
put (gArenaL + gArenaR) div 2 into tCx
91509150
put gArenaB - 36 into tBaseY
91519151
put placeBox(tCx, tBaseY, 42, 42, "120,200,232") into tBox
9152-
b2kSetDensity tBox, 0.35 -- light enough for one balloon to lift
9153-
set the uDensity of tBox to 0.35
9152+
b2kSetDensity tBox, 0.1 -- light enough that one balloon's buoyancy (0.6g) actually lifts it
9153+
set the uDensity of tBox to 0.1
91549154
put placeBalloon(tCx, tBaseY - 150) into tBalloon
91559155
get connectJoint("rope", tBalloon, tBox, tCx, tBaseY - 80, 0)
91569156
renderBuild
@@ -9162,14 +9162,15 @@ end buildRecipeBalloonLift
91629162
on buildRecipePlateBomb
91639163
if gMode is "run" then toggleMode
91649164
clearAll
9165-
local tCx, tPlateX, tTowerX, tI, tBomb
9165+
local tCx, tPlateX, tTowerX, tI, tBomb, tPlate
91669166
put (gArenaL + gArenaR) div 2 into tCx
91679167
put tCx - 130 into tPlateX
91689168
put tCx + 120 into tTowerX
9169-
get placePlate(tPlateX, gArenaB - 8)
9169+
put placePlate(tPlateX, gArenaB - 8) into tPlate
91709170
get placeBall(tPlateX, gArenaT + 60, 40, "232,182,92")
91719171
put placeBomb(tTowerX, gArenaB - 28) into tBomb
9172-
set the uFuseOnRun of tBomb to false -- this bomb fires from the PLATE, not its own fuse
9172+
set the uFuseOnRun of tBomb to false -- this bomb fires from the PLATE's wire, not its own fuse
9173+
addWire tPlate, tBomb -- the trigger link (this was missing): plate -> bomb
91739174
repeat with tI = 1 to 4
91749175
get placeBox(tTowerX, gArenaB - 66 - tI * 34, 46, 30, "214,92,92")
91759176
end repeat
@@ -9234,13 +9235,19 @@ end buildRecipeFanTower
92349235
on buildRecipeMagnetCatch
92359236
if gMode is "run" then toggleMode
92369237
clearAll
9237-
local tCx, tCy, tMag, tI
9238+
local tCx, tCy, tMag, tI, tLoX, tHiX, tLoY, tHiY
92389239
put (gArenaL + gArenaR) div 2 into tCx
92399240
put (gArenaT + gArenaB) div 2 into tCy
92409241
put placeMagnet(tCx, tCy) into tMag
9241-
set the uMagRange of tMag to 340
9242+
set the uMagRange of tMag to 360
9243+
-- Scatter the balls INSIDE the magnet's reach (clamped to the arena), so every
9244+
-- one is actually caught -- not just whichever happened to land within range.
9245+
put max(gArenaL + 40, tCx - 280) into tLoX
9246+
put min(gArenaR - 40, tCx + 280) into tHiX
9247+
put max(gArenaT + 40, tCy - 170) into tLoY
9248+
put min(gArenaB - 50, tCy + 170) into tHiY
92429249
repeat with tI = 1 to 6
9243-
get placeBall(rnd(gArenaL + 50, gArenaR - 50), rnd(gArenaT + 40, gArenaB - 60), 30, "206,124,206")
9250+
get placeBall(rnd(tLoX, tHiX), rnd(tLoY, tHiY), 30, "206,124,206")
92449251
end repeat
92459252
renderBuild
92469253
put "Magnet Catch — press Run: the magnet pulls the scattered balls toward it." into gStatus
@@ -9254,15 +9261,15 @@ on buildRecipeCatapult
92549261
local tCx, tBaseY, tFulcrum, tArm, tBall, tWeight
92559262
put (gArenaL + gArenaR) div 2 into tCx
92569263
put gArenaB - 70 into tBaseY
9257-
put placeAnchor(tCx, tBaseY) into tFulcrum
9264+
put placeAnchor(tCx, tBaseY - 16) into tFulcrum -- pivot ON the arm centreline; was 16px below its CG (an unstable inverted pivot that tipped the arm over before the weight landed)
92589265
put placeBox(tCx, tBaseY - 16, 200, 14, "180,150,90") into tArm
92599266
set the uDensity of tArm to 0.6
92609267
b2kSetDensity tArm, 0.6
92619268
get connectJoint("hinge", tArm, tFulcrum, tCx, tBaseY - 16, 0)
9262-
put placeBall(tCx - 84, tBaseY - 36, 30, "232,182,92") into tBall
9263-
put placeBox(tCx + 78, tBaseY - 172, 54, 54, "214,92,92") into tWeight
9264-
set the uDensity of tWeight to 2.6
9265-
b2kSetDensity tWeight, 2.6
9269+
put placeBall(tCx - 84, tBaseY - 39, 30, "232,182,92") into tBall -- rests on the left arm
9270+
put placeBox(tCx + 78, tBaseY - 110, 54, 54, "214,92,92") into tWeight -- drops a short, fast way onto the right arm
9271+
set the uDensity of tWeight to 3.4
9272+
b2kSetDensity tWeight, 3.4
92669273
renderBuild
92679274
put "Catapult — press Run: the heavy block drops on the right arm and flings the ball off the left." into gStatus
92689275
updateHud
@@ -9276,7 +9283,7 @@ end buildRecipeCatapult
92769283
on buildRecipeCannon
92779284
if gMode is "run" then toggleMode
92789285
clearAll
9279-
local tX, tBaseY, tBarrel, tBase, tBall, tI
9286+
local tX, tBaseY, tBarrel, tBase, tBall, tI, tStackX
92809287
put gArenaL + 80 into tX
92819288
put gArenaB - 96 into tBaseY
92829289
put placeBox(tX + 18, tBaseY + 34, 66, 30, "92,70,52") into tBase -- carriage
@@ -9290,12 +9297,15 @@ on buildRecipeCannon
92909297
put placeBall(tX + 88, tBaseY, 26, "40,42,50") into tBall -- cannonball at the muzzle
92919298
set the uDensity of tBall to 2.6
92929299
b2kSetDensity tBall, 2.6
9293-
set the uLaunchSpeed of tBall to 1150
9294-
set the uLaunchDir of tBall to 18 -- across and slightly up
9300+
set the uLaunchSpeed of tBall to 1000
9301+
set the uLaunchDir of tBall to 8 -- a near-flat shot, so it strikes the stack instead of arcing over it
92959302
set the uLayer of tBall to 1
92969303
applyCollisionLayer tBall
9297-
repeat with tI = 0 to 4 -- crate stack downrange
9298-
get placeBox(gArenaR - 150, gArenaB - 22 - tI * 30, 46, 28, "200,120,80")
9304+
-- Put the stack a fixed distance downrange (inside the flat shot's range), not
9305+
-- at the far wall — otherwise on a wide stage the ball drops short or sails past.
9306+
put min(tX + 688, gArenaR - 110) into tStackX
9307+
repeat with tI = 0 to 4 -- crate stack
9308+
get placeBox(tStackX, gArenaB - 22 - tI * 30, 46, 28, "200,120,80")
92999309
end repeat
93009310
renderBuild
93019311
put "Cannon — press Run: the ball fires across the field. Knock the crate stack down!" into gStatus
@@ -9320,7 +9330,7 @@ on buildRecipeTrebuchet
93209330
set the uDensity of tWeight to 4
93219331
b2kSetDensity tWeight, 4
93229332
get connectJoint("weld", tWeight, tArm)
9323-
put placeBall(tCx + 162, tBaseY + 6, 26, "232,182,92") into tBall
9333+
put placeBall(tCx + 162, tBaseY - 19, 26, "232,182,92") into tBall -- rests ON TOP of the long arm so the whip-up flings it (was below the arm)
93249334
set the uDensity of tBall to 0.8
93259335
b2kSetDensity tBall, 0.8
93269336
renderBuild
@@ -9340,12 +9350,12 @@ on buildRecipeCrane
93409350
put placeBox(tX, tBaseY - 110, 26, 220, "92,98,112") into tMast
93419351
set the uBodyType of tMast to "static"
93429352
b2kSetType tMast, "static"
9343-
put placeAnchor(tX, tTop) into tPivot
9344-
put placeBox(tX + 96, tTop, 210, 14, "180,150,90") into tJib
9353+
put placeAnchor(tX + 13, tTop) into tPivot -- pivot at the mast's right edge
9354+
put placeBox(tX + 118, tTop, 210, 14, "180,150,90") into tJib -- jib cantilevers RIGHT from the pivot, clear of the mast (its left end used to overlap the mast and jam the swing)
93459355
set the uDensity of tJib to 0.4
93469356
b2kSetDensity tJib, 0.4
9347-
get connectJoint("hinge", tJib, tPivot, tX, tTop, 26) -- 26 deg/s motor swings the jib
9348-
put placeBall(tX + 184, tTop + 92, 34, "232,182,92") into tLoad
9357+
get connectJoint("hinge", tJib, tPivot, tX + 13, tTop, 26) -- 26 deg/s motor swings the jib
9358+
put placeBall(tX + 200, tTop + 92, 34, "232,182,92") into tLoad
93499359
set the uDensity of tLoad to 2
93509360
b2kSetDensity tLoad, 2
93519361
get connectJoint("rope", tJib, tLoad)
@@ -9359,31 +9369,31 @@ end buildRecipeCrane
93599369
on buildRecipeWreckingBall
93609370
if gMode is "run" then toggleMode
93619371
clearAll
9362-
local tX, tBaseY, tTop, tLeg, tBeam, tPivot, tBall, tI
9363-
put gArenaL + 120 into tX
9364-
put gArenaB - 30 into tBaseY
9365-
put tBaseY - 210 into tTop
9366-
put placeBox(tX, tBaseY - 105, 18, 210, "92,98,112") into tLeg
9367-
set the uBodyType of tLeg to "static"
9368-
b2kSetType tLeg, "static"
9369-
put placeBox(tX + 230, tBaseY - 105, 18, 210, "92,98,112") into tLeg
9370-
set the uBodyType of tLeg to "static"
9371-
b2kSetType tLeg, "static"
9372-
put placeBox(tX + 115, tTop, 260, 16, "92,98,112") into tBeam
9372+
local tX, tTop, tMast, tBeam, tPivot, tBall, tWallX, tI
9373+
put gArenaL + 130 into tX
9374+
put gArenaB - 250 into tTop
9375+
-- A mast with a beam cantilevered to the right; the ball hangs off the beam end and
9376+
-- swings RIGHT into the wall. (The old gantry pinned the ball between two legs, so its
9377+
-- short arc never reached the far wall.)
9378+
put placeBox(tX, (gArenaB + tTop) div 2, 22, gArenaB - tTop, "92,98,112") into tMast
9379+
set the uBodyType of tMast to "static"
9380+
b2kSetType tMast, "static"
9381+
put placeBox(tX + 100, tTop, 200, 16, "92,98,112") into tBeam
93739382
set the uBodyType of tBeam to "static"
93749383
b2kSetType tBeam, "static"
9375-
put placeAnchor(tX + 40, tTop) into tPivot
9376-
put placeBall(tX + 40, tTop + 140, 40, "60,64,74") into tBall
9377-
set the uDensity of tBall to 4.5
9378-
b2kSetDensity tBall, 4.5
9384+
put placeAnchor(tX + 188, tTop) into tPivot
9385+
put placeBall(tX + 188, tTop + 150, 44, "60,64,74") into tBall -- heavy ball roped to the beam end
9386+
set the uDensity of tBall to 5
9387+
b2kSetDensity tBall, 5
93799388
get connectJoint("rope", tPivot, tBall)
9380-
set the uLaunchSpeed of tBall to 540
9389+
set the uLaunchSpeed of tBall to 600
93819390
set the uLaunchDir of tBall to 0 -- shove right, into the wall
9391+
put tX + 300 into tWallX -- inside the ball's forward swing reach
93829392
repeat with tI = 0 to 5
9383-
get placeBox(gArenaR - 160, gArenaB - 22 - tI * 30, 60, 28, "200,120,80")
9393+
get placeBox(tWallX, gArenaB - 22 - tI * 30, 60, 28, "200,120,80")
93849394
end repeat
93859395
renderBuild
9386-
put "Wrecking Ball — press Run: the ball swings into the brick wall and smashes it down." into gStatus
9396+
put "Wrecking Ball — press Run: the ball swings off the beam into the brick wall and smashes it down." into gStatus
93879397
updateHud
93889398
end buildRecipeWreckingBall
93899399

0 commit comments

Comments
 (0)