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

Migrated from github.com/amirmushichge/pixel-plays

Add Carrot Pull: the playable page and its place in the catalogue, on the rules in `carrot-pull/bed.js` #348

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Carrot Pull is playable at `/carrot-pull/` and listed in the catalogue. `bed.js` is untouched and the page drives it only through `CarrotPull`. The new page tests, the Carrot Pull playtests, `serve.test.mjs`, `shell.test.mjs` and the town/limits tests pass; I did not run the whole suite. `scripts/gate.ts` and `scripts/fast.ts` don't exist in this clone. The repo has no `tsconfig.json`, so `tsc --n…

shipped production is serving it deploy 5b5fb07

opened this

Carrot Pull is playable at /carrot-pull/ and listed in the catalogue. bed.js is untouched and the page drives it only through CarrotPull. The new page tests, the Carrot Pull playtests, serve.test.mjs, shell.test.mjs and the town/limits tests pass; I did not run the whole suite. scripts/gate.ts and scripts/fast.ts don't exist in this clone. The repo has no tsconfig.json, so tsc --noEmit only printed its usage text and checked nothing. The branch was already up to date with main at push, so there was no rebase.

What changed

  • Page: carrot-pull/index.html draws the 4×6 bed with each carrot at its stage, the gardener and the rabbit. The stages differ by shape:

- A pale seed. - A sprout of two round leaves, with no root showing. - A ripe carrot with upright fronds over a low orange shoulder. - A woody carrot with brown leaves splayed flat round a tall pale root.

  • Controls: arrows or WASD walk, Space pulls, R restarts. On touch, tap a neighbouring square to walk and tap the gardener's square to pull. A tick runs every 0.6 s, so a day is 24 s.
  • HUD and announcements: the HUD shows score, ticks left, pulled ripe and lost, all read from P. Every move, refusal reason, nibble and the end line goes to the aria-live region.
  • Visual rules and mute: it follows the README Visual rules, the rules popup is three lines, and #mute is there with no .mp3. Only the ripe fronds sway, and that stops under prefers-reduced-motion. The README ambient list says so.
  • Catalogue:

- Added to GAMES in shell.js and to the root index.html. - Added to the README Games table and the list of games with their own sound. - The town needed no edit: it builds one building per GAMES entry. - bun scripts/og.mjs has been run.

  • Tests:

- rounds.mjs has a bot that walks to the nearest ripe carrot and pulls it. It reaches Day over: score N… with N above 0, which an untouched game never does. - serve.test.mjs asserts /carrot-pull/ and /carrot-pull/bed.js answer 200. - carrot-pull/page.test.mjs is new, with six tests for keys, pulling, touch, ticking and the end line, restart, reduced motion and mute. - The page's playtests run in about 1.6 s, inside the per-game budget.

Things to look at

  • Arcade was not an allowed kind. I added it to the allowed list in serve.test.mjs and to the kinds comment in shell.js.
  • flushShadows() never clears pendingShadows, so a game that draws every frame must clear it itself. I do that at the top of draw(). Ticket Booth doesn't, so its list grows every frame. I left it alone.

Not done

  • No best-score saving.
  • The rules gave me everything the page needed, so there is nothing to flag there.

Try it: bun serve.mjs, open /carrot-pull/, and walk to a carrot with upright fronds and an orange shoulder, then press Space.

🤖 Generated with Claude Code

Closes #344

commented

Carrot Pull is playable at /carrot-pull/ and listed in the catalogue. bed.js is untouched and the page drives it only through CarrotPull. The new page tests, the Carrot Pull playtests, serve.test.mjs, shell.test.mjs and the town/limits tests pass; I did not run the whole suite. scripts/gate.ts and scripts/fast.ts don't exist in this clone. The repo has no tsconfig.json, so tsc --noEmit only printed its usage text and checked nothing. The branch was already up to date with main at push, so there was no rebase.

What changed

  • Page: carrot-pull/index.html draws the 4×6 bed with each carrot at its stage, the gardener and the rabbit. The stages differ by shape:

- A pale seed. - A sprout of two round leaves, with no root showing. - A ripe carrot with upright fronds over a low orange shoulder. - A woody carrot with brown leaves splayed flat round a tall pale root.

  • Controls: arrows or WASD walk, Space pulls, R restarts. On touch, tap a neighbouring square to walk and tap the gardener's square to pull. A tick runs every 0.6 s, so a day is 24 s.
  • HUD and announcements: the HUD shows score, ticks left, pulled ripe and lost, all read from P. Every move, refusal reason, nibble and the end line goes to the aria-live region.
  • Visual rules and mute: it follows the README Visual rules, the rules popup is three lines, and #mute is there with no .mp3. Only the ripe fronds sway, and that stops under prefers-reduced-motion. The README ambient list says so.
  • Catalogue:

- Added to GAMES in shell.js and to the root index.html. - Added to the README Games table and the list of games with their own sound. - The town needed no edit: it builds one building per GAMES entry. - bun scripts/og.mjs has been run.

  • Tests:

- rounds.mjs has a bot that walks to the nearest ripe carrot and pulls it. It reaches Day over: score N… with N above 0, which an untouched game never does. - serve.test.mjs asserts /carrot-pull/ and /carrot-pull/bed.js answer 200. - carrot-pull/page.test.mjs is new, with six tests for keys, pulling, touch, ticking and the end line, restart, reduced motion and mute. - The page's playtests run in about 1.6 s, inside the per-game budget.

Things to look at

  • Arcade was not an allowed kind. I added it to the allowed list in serve.test.mjs and to the kinds comment in shell.js.
  • flushShadows() never clears pendingShadows, so a game that draws every frame must clear it itself. I do that at the top of draw(). Ticket Booth doesn't, so its list grows every frame. I left it alone.

Not done

  • No best-score saving.
  • The rules gave me everything the page needed, so there is nothing to flag there.

Try it: bun serve.mjs, open /carrot-pull/, and walk to a carrot with upright fronds and an orange shoulder, then press Space.

🤖 Generated with Claude Code

Approved

Approved. The preview serves /carrot-pull/ and /carrot-pull/bed.js (200). Keys, Space, tap-to-walk and tap-to-pull go through CarrotPull only. Moves, refusals, nibbles and the end line reach the aria-live region. The canvas is focusable with a how-to-play label. The HUD moves into the page flow under 520px. The mute button and the reduced-motion handling are in place. Catalogue, README, og card, rounds and serve tests are all present. I could not open the forge screenshots (the file tools are confined to the clone), so I did not check the layout by eye. Next, two things: (1) the mute button changes its text to 'sound off' and also sets aria-pressed, which a screen reader announces as a button named 'sound off' that is pressed. Keep the label fixed ('sound') and let aria-pressed carry the state. (2) Key input is bound only to the canvas, so after clicking Mute, keys do nothing until the player tabs back. Put the walk/pull/restart listener on document, or return focus to the canvas after mute. The Ticket Booth pendingShadows growth that Quill flagged should get its own issue.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs