Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Add Soapbox Derby: steer a wooden cart down a cobbled hill between the hay bales #78

Parked opened this
Closed without merging

Soapbox Derby is added and pushed. The cart rolls down a 360 m cobbled street between gates of hay bales and finishes under a chequered banner. The new unit and page tests, the Soapbox Derby playtests, serve.test.mjs and shell.test.mjs pass.

Notes

stopped parked by the crew deploy 36c9fb7

opened this

Soapbox Derby is added and pushed. The cart rolls down a 360 m cobbled street between gates of hay bales and finishes under a chequered banner. The new unit and page tests, the Soapbox Derby playtests, serve.test.mjs and shell.test.mjs pass. I did not run the whole bun test suite, only the files above. The look is only checked from the generated share card (the opening frame), not in a browser. There is no scripts/gate.ts or scripts/fast.ts in this clone. bun x tsc --noEmit has no tsconfig here, so it only printed its help text.

What changed

  • Rules: soapbox-derby/cart.js holds all the rules, with plain data in and out. Gravity speeds the cart up to 18 m/s. Steering is a first-order lag of 0.35 s, so the cart answers late. A bale keeps 35% of the speed, costs a life and gives 1 s of immunity so one bale can't cost twice. A flagstone strip gives 1.5 s of extra push and a higher top speed. Gate gaps narrow in a straight line from 3.4 m to 1.7 m, alternating left and right from a seeded roll. Three lives gone ends the run as lost, and reaching 360 m ends it as won with the time and best time.
  • Tests: soapbox-derby/cart.test.mjs covers each rule in the issue, plus that every gap fits the street and that a steady driver can win in 15–40 s. soapbox-derby/page.test.mjs boots the real page and checks that drag and the arrow keys steer and the HUD updates.
  • Page: soapbox-derby/index.html uses the 360x280 canvas and fixed camera of Tram Line. The ground is baked into 8 scroll phases and bales and the banner are recorded once and shifted in whole pixels, so the per-frame cost is small. Only the cart is drawn each frame. The bunting is the one ambient motion, 8 fps, and it holds still under prefers-reduced-motion.
  • HUD and controls: The HUD shows time, metres to go, lives and best time (kept in localStorage). Drag anywhere on the canvas steers, and 100 canvas pixels is full lock. Left/right arrows (also A/D) steer too. The canvas aria-label says how to play, and the rules popup is three lines. #mute is there and there is no .mp3.
  • Listing: shell.js has the exact GAMES entry from the issue, with matching index.html <li>, README Games row and the README list of games without music. og/soapbox-derby.png, og/home.png and the share tags came from bun scripts/og.mjs. serve.test.mjs asserts /soapbox-derby/ and /soapbox-derby/cart.js answer 200.

Left as it is

  • Steering holds where you leave it after you release a drag or a key, instead of re-centring.
  • Hitting a kerb bale costs nothing. The kerb bales are scenery and the cart is clamped inside the street.
  • The share card shows the opening frame, so no gate is in view yet.
  • No dependencies were added.

Try it

  • Run bun serve.mjs and open /soapbox-derby/.
  • Drag or use the arrow keys.
  • Steer early toward the gap in each gate, and aim for the flagstone strips between gates.
  • Merging means a one-line rebase against the other new-game pulls in shell.js, index.html, README.md and serve.test.mjs.

🤖 Generated with Claude Code

Closes #66

3 earlier comments
commented

Soapbox Derby is added and pushed. The cart rolls down a 360 m cobbled street between gates of hay bales and finishes under a chequered banner. The new unit and page tests, the Soapbox Derby playtests, serve.test.mjs and shell.test.mjs pass. I did not run the whole bun test suite, only the files above. The look is only checked from the generated share card (the opening frame), not in a browser. There is no scripts/gate.ts or scripts/fast.ts in this clone. bun x tsc --noEmit has no tsconfig here, so it only printed its help text.

What changed

  • Rules: soapbox-derby/cart.js holds all the rules, with plain data in and out. Gravity speeds the cart up to 18 m/s. Steering is a first-order lag of 0.35 s, so the cart answers late. A bale keeps 35% of the speed, costs a life and gives 1 s of immunity so one bale can't cost twice. A flagstone strip gives 1.5 s of extra push and a higher top speed. Gate gaps narrow in a straight line from 3.4 m to 1.7 m, alternating left and right from a seeded roll. Three lives gone ends the run as lost, and reaching 360 m ends it as won with the time and best time.
  • Tests: soapbox-derby/cart.test.mjs covers each rule in the issue, plus that every gap fits the street and that a steady driver can win in 15–40 s. soapbox-derby/page.test.mjs boots the real page and checks that drag and the arrow keys steer and the HUD updates.
  • Page: soapbox-derby/index.html uses the 360x280 canvas and fixed camera of Tram Line. The ground is baked into 8 scroll phases and bales and the banner are recorded once and shifted in whole pixels, so the per-frame cost is small. Only the cart is drawn each frame. The bunting is the one ambient motion, 8 fps, and it holds still under prefers-reduced-motion.
  • HUD and controls: The HUD shows time, metres to go, lives and best time (kept in localStorage). Drag anywhere on the canvas steers, and 100 canvas pixels is full lock. Left/right arrows (also A/D) steer too. The canvas aria-label says how to play, and the rules popup is three lines. #mute is there and there is no .mp3.
  • Listing: shell.js has the exact GAMES entry from the issue, with matching index.html <li>, README Games row and the README list of games without music. og/soapbox-derby.png, og/home.png and the share tags came from bun scripts/og.mjs. serve.test.mjs asserts /soapbox-derby/ and /soapbox-derby/cart.js answer 200.

Left as it is

  • Steering holds where you leave it after you release a drag or a key, instead of re-centring.
  • Hitting a kerb bale costs nothing. The kerb bales are scenery and the cart is clamped inside the street.
  • The share card shows the opening frame, so no gate is in view yet.
  • No dependencies were added.

Try it

  • Run bun serve.mjs and open /soapbox-derby/.
  • Drag or use the arrow keys.
  • Steer early toward the gap in each gate, and aim for the flagstone strips between gates.
  • Merging means a one-line rebase against the other new-game pulls in shell.js, index.html, README.md and serve.test.mjs.

🤖 Generated with Claude Code

commented

I merged main into the branch, resolved the conflicts and pushed it (bb8e539). It should merge cleanly again, though I haven't re-checked the pull itself.

  • README.md, index.html, shell.js: main added Goalkeeper in the same spots as my Soapbox Derby lines, so I kept both entries. Goalkeeper comes first and Soapbox Derby follows.
  • No-music list: the README sentence now reads "…Bell Tower, Goalkeeper and Soapbox Derby play on their own sound effects".
  • og/home.png: this is a binary file and could not be merged. I took main's copy, then re-ran bun scripts/og.mjs, which rebuilt it with every card, Goalkeeper and Soapbox Derby included. og/soapbox-derby.png and its share tags are unchanged.

I ran serve.test.mjs, shell.test.mjs and the Soapbox Derby tests, and all 61 pass. I did not re-run the full playtest suite, so Goalkeeper's own tests are untested on the merged branch. The forge's check will run those.

commented

I merged main into the Soapbox Derby branch and pushed it. The full suite passes locally: 518 tests, 0 failures. I did not run bun x tsc --noEmit or the design lint for this merge.

Two files conflicted:

  • README.md: I kept main's version of the no-music list and put Soapbox Derby back in it, next to Wood Split. The list now ends "Goalkeeper, Wood Split and Soapbox Derby play on their own sound effects".
  • og/home.png: a binary file can't be merged by hand. I took main's copy and re-ran bun scripts/og.mjs, so the home collage includes both Wood Split and Soapbox Derby. serve.test.mjs checks that collage byte for byte, and it passes.

The merge commit is 36c9fb7.

commented

Closed by the crew: main moved under it 2 times and the branch could not be brought up to date. Conflicting files: README.md, og/home.png, serve.test.mjs.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs