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

Migrated from github.com/amirmushichge/pixel-plays

Add Patchwork Quilt: the playable page and its place in the catalogue, on the rules in `quilt/patch.js` #245

Merged opened this

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

Merged

Patchwork Quilt is now playable at /quilt/, built on quilt/patch.js, which it drives through start, rotate, swap, matches and solution. One change from the issue. The issue says a tap turns a patch.

Notes

shipped production is serving it deploy ab54f53

opened this

Patchwork Quilt is now playable at /quilt/, built on quilt/patch.js, which it drives through start, rotate, swap, matches and solution.

One change from the issue. The issue says a tap turns a patch. Here the first tap picks a patch and draws a yellow outline, with no move spent. Tapping the picked patch turns it a quarter and costs a move. With one picked, tapping another patch swaps the two. This way a swap never wastes a turn on the first patch. Tapping off the quilt or pressing Escape lets go. Arrows move a cursor and Space or Enter does what a tap does.

The page.

  • Scene: the 3x3 quilt on a cottage bed, with a 360x280 canvas, the fixed camera and hard shadows falling screen-right. Each patch is a fabric colour with four stitch patterns (running stitch, dots, zigzag, ticks) along its edges.
  • Seams: a matching seam shows three cross-stitches and a mismatched one shows an open dark gap, so neither depends on colour alone.
  • HUD: moves left, matching edges and score are read straight from the rules state.
  • Motion: only the window curtain moves, and it is still under prefers-reduced-motion.
  • Accessibility and sound: the canvas aria-label says how to play, the rules popup is three lines, there is a #mute button and no .mp3.

Catalogue.

  • Listing: I added the shell.js entry exactly as given and the matching <li> in the root index.html.
  • README: the Games table row, the games-without-music list and the ambient-motion list are updated.
  • Town and cards: the town builds from GAMES, so it needed no edit of its own. bun scripts/og.mjs has been run, giving og/quilt.png and a refreshed og/home.png.
  • Tests: rounds.mjs has a scripted round that plays Quilt.solution(seed) to the win line. serve.test.mjs asserts that /quilt/ and /quilt/patch.js answer 200. quilt/page.test.mjs adds 7 tests for pick, turn, swap, release, keyboard, HUD and win-then-restart.

Checks.

  • Passed: quilt/page.test.mjs (7), the quilt cases in playtest.test.mjs (5), serve.test.mjs (74) and shell.test.mjs plus town.test.mjs (44 together with the quilt tests).
  • Not run: bun scripts/design-lint.ts, scripts/gate.ts and bun x tsc --noEmit. The repository has no design-lint.ts, no gate.ts and no package.json.
  • Not run: the full bun test, only the files above. The forge runs the full check on the push.

Not done. I did not look at the page in a browser, only the generated share card. I did no animated curtain screenshot or Lighthouse pass.

To try it. Run the app and open /quilt/. Tap a patch twice to turn it, or tap two patches to swap them.

Rebase. git pull --rebase found nothing to rebase onto, because the branch only existed locally until this push, and the push was clean. Later pulls that append to the same lists may still conflict.

Closes #218

commented

Patchwork Quilt is now playable at /quilt/, built on quilt/patch.js, which it drives through start, rotate, swap, matches and solution.

One change from the issue. The issue says a tap turns a patch. Here the first tap picks a patch and draws a yellow outline, with no move spent. Tapping the picked patch turns it a quarter and costs a move. With one picked, tapping another patch swaps the two. This way a swap never wastes a turn on the first patch. Tapping off the quilt or pressing Escape lets go. Arrows move a cursor and Space or Enter does what a tap does.

The page.

  • Scene: the 3x3 quilt on a cottage bed, with a 360x280 canvas, the fixed camera and hard shadows falling screen-right. Each patch is a fabric colour with four stitch patterns (running stitch, dots, zigzag, ticks) along its edges.
  • Seams: a matching seam shows three cross-stitches and a mismatched one shows an open dark gap, so neither depends on colour alone.
  • HUD: moves left, matching edges and score are read straight from the rules state.
  • Motion: only the window curtain moves, and it is still under prefers-reduced-motion.
  • Accessibility and sound: the canvas aria-label says how to play, the rules popup is three lines, there is a #mute button and no .mp3.

Catalogue.

  • Listing: I added the shell.js entry exactly as given and the matching <li> in the root index.html.
  • README: the Games table row, the games-without-music list and the ambient-motion list are updated.
  • Town and cards: the town builds from GAMES, so it needed no edit of its own. bun scripts/og.mjs has been run, giving og/quilt.png and a refreshed og/home.png.
  • Tests: rounds.mjs has a scripted round that plays Quilt.solution(seed) to the win line. serve.test.mjs asserts that /quilt/ and /quilt/patch.js answer 200. quilt/page.test.mjs adds 7 tests for pick, turn, swap, release, keyboard, HUD and win-then-restart.

Checks.

  • Passed: quilt/page.test.mjs (7), the quilt cases in playtest.test.mjs (5), serve.test.mjs (74) and shell.test.mjs plus town.test.mjs (44 together with the quilt tests).
  • Not run: bun scripts/design-lint.ts, scripts/gate.ts and bun x tsc --noEmit. The repository has no design-lint.ts, no gate.ts and no package.json.
  • Not run: the full bun test, only the files above. The forge runs the full check on the push.

Not done. I did not look at the page in a browser, only the generated share card. I did no animated curtain screenshot or Lighthouse pass.

To try it. Run the app and open /quilt/. Tap a patch twice to turn it, or tap two patches to swap them.

Rebase. git pull --rebase found nothing to rebase onto, because the branch only existed locally until this push, and the push was clean. Later pulls that append to the same lists may still conflict.

Approved

Preview serves /quilt/, /quilt/patch.js and og/quilt.png (200). Drives only quilt/patch.js, cross-stitch and gap marks are shape not colour, the selection is outlined, keyboard play works (arrows, Space, Escape), the curtain stops under reduced motion, and the shell, index, README, rounds and serve test entries are all in. One note: a tap picks and a second tap turns, where the issue said a tap turns; this is stated in the pull and keeps swaps free, so I accept it. Next two things: (1) show the picked state in the status line for screen readers with the patch's row and column, not only its number; (2) add a small touch hint on first load until a patch is picked.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs