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

Migrated from github.com/amirmushichge/pixel-plays

Add Jam Jars: the playable page and its place in the catalogue, on the rules in `jam-jars/shelf.js` #284

Merged opened this

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

Merged

Jam Jars is now a playable game on jam-jars/index.html, built on jam-jars/shelf.js, and I've pushed it. The full playtest suite passes, including a scripted round that clears all four shelves to the win line. I also ran shell.test.mjs, town.test.mjs and serve.test.mjs, and they pass.

Notes

shipped production is serving it deploy ab54f53

opened this

Jam Jars is now a playable game on jam-jars/index.html, built on jam-jars/shelf.js, and I've pushed it. The full playtest suite passes, including a scripted round that clears all four shelves to the win line. I also ran shell.test.mjs, town.test.mjs and serve.test.mjs, and they pass. I did not run the design lint, tsc or the gate: scripts/design-lint.ts, scripts/gate.ts and scripts/fast.ts don't exist in this repository, and bun x tsc --noEmit doesn't run here either (no TypeScript config).

What changed

  • The game: a pantry shelf of 3–5 glass jars with their fruit layers showing through the glass. Tap a jar or press its number key to lift it, then tap another to pour. An undo button and the pours-against-par count sit in the HUD.
  • Rules and HUD: the page only calls start, pour, undo, restart and top from the rules, and the status line shows the rules' own line. When a pour is refused, the HUD says why and nothing changes.
  • Colour-blind play: each fruit has its own pip pattern as well as its colour (plum dots, fig stripes, quince checks).
  • House style: 360x280 canvas, fixed camera, hard shadows to the screen-right. The sunlight band on the empty glass stops under prefers-reduced-motion. The canvas aria-label says how to play, the rules popup is four lines, #mute is there, and no .mp3 is committed.
  • Extra keys: besides the digit keys, arrows move along the shelf, Space or Enter picks up or pours, U undoes, R restarts the shelf, and Escape puts a held jar down.
  • Catalogue: the GAMES entry in shell.js, the <li> in the root index.html, the README Games row, the no-music list and the reduced-motion note. The town building comes from GAMES, so town.js didn't change. bun scripts/og.mjs was run, giving og/jam-jars.png and a regenerated og/home.png.
  • Tests:

- jam-jars/page.test.mjs is new: pick up and pour, refused pours, keys, undo, patterns, one repaint per change, mute and the page source checks. - The rounds.mjs scripted round finds each shelf's shortest solution with a search over the rules' own pour. - serve.test.mjs asserts that /jam-jars/ and /jam-jars/shelf.js answer 200.

What I chose not to do

  • No framework or dependency.
  • No drag-to-pour; the issue asks for tap.
  • The shelf plank and wall are drawn directly in screen space rather than as engine boxes, because a diagonal engine box can't make a horizontal shelf. The camera angle still holds.

To try it

  • Run bun serve.mjs and open /jam-jars/.
  • Run bun test jam-jars/.

The branch was already level with origin/main when I pushed, so the rebase had nothing to do.

Closes #259

1 earlier comment · 1 event
commented

Jam Jars is now a playable game on jam-jars/index.html, built on jam-jars/shelf.js, and I've pushed it. The full playtest suite passes, including a scripted round that clears all four shelves to the win line. I also ran shell.test.mjs, town.test.mjs and serve.test.mjs, and they pass. I did not run the design lint, tsc or the gate: scripts/design-lint.ts, scripts/gate.ts and scripts/fast.ts don't exist in this repository, and bun x tsc --noEmit doesn't run here either (no TypeScript config).

What changed

  • The game: a pantry shelf of 3–5 glass jars with their fruit layers showing through the glass. Tap a jar or press its number key to lift it, then tap another to pour. An undo button and the pours-against-par count sit in the HUD.
  • Rules and HUD: the page only calls start, pour, undo, restart and top from the rules, and the status line shows the rules' own line. When a pour is refused, the HUD says why and nothing changes.
  • Colour-blind play: each fruit has its own pip pattern as well as its colour (plum dots, fig stripes, quince checks).
  • House style: 360x280 canvas, fixed camera, hard shadows to the screen-right. The sunlight band on the empty glass stops under prefers-reduced-motion. The canvas aria-label says how to play, the rules popup is four lines, #mute is there, and no .mp3 is committed.
  • Extra keys: besides the digit keys, arrows move along the shelf, Space or Enter picks up or pours, U undoes, R restarts the shelf, and Escape puts a held jar down.
  • Catalogue: the GAMES entry in shell.js, the <li> in the root index.html, the README Games row, the no-music list and the reduced-motion note. The town building comes from GAMES, so town.js didn't change. bun scripts/og.mjs was run, giving og/jam-jars.png and a regenerated og/home.png.
  • Tests:

- jam-jars/page.test.mjs is new: pick up and pour, refused pours, keys, undo, patterns, one repaint per change, mute and the page source checks. - The rounds.mjs scripted round finds each shelf's shortest solution with a search over the rules' own pour. - serve.test.mjs asserts that /jam-jars/ and /jam-jars/shelf.js answer 200.

What I chose not to do

  • No framework or dependency.
  • No drag-to-pour; the issue asks for tap.
  • The shelf plank and wall are drawn directly in screen space rather than as engine boxes, because a diagonal engine box can't make a horizontal shelf. The camera angle still holds.

To try it

  • Run bun serve.mjs and open /jam-jars/.
  • Run bun test jam-jars/.

The branch was already level with origin/main when I pushed, so the rebase had nothing to do.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

I merged main into this branch, resolved the conflicts, and pushed (c803163). The 517 tests in the files I ran pass. I did not run the full suite; the forge's check does that on the push.

main had added Conkers in the same places this pull adds Jam Jars, so both games now sit side by side:

  • Catalogue and registration: README.md (table row), index.html (fallback list) and shell.js (GAMES) list both games.
  • Round scripts: rounds.mjs has the jam-jars entry next to the conkers one.
  • Server test: serve.test.mjs has a "served" test for each game.
  • README prose: the "sound effects" list now ends "Stained Glass, Conkers and Jam Jars". The ambient-motion sentence keeps both games' clauses.
  • Share cards: I regenerated og/home.png with bun scripts/og.mjs so the grid includes both games. Nothing else in og/ changed.

I ran serve.test.mjs, the jam-jars and conkers tests, and playtest.test.mjs. bun x tsc --noEmit printed only the compiler's usage text, with no type errors listed.

Approved

Jam Jars works in the preview: /jam-jars/ and /jam-jars/shelf.js answer 200. The page drives only shelf.js, shows fruit by pip pattern as well as colour, has keyboard, undo and mute, and the HUD is aria-live. I read the source and the diff; I did not finish a local test run, so the green check is what I rely on for bun test. Next: (1) make jars reachable by screen readers as real buttons or a listbox, not only via canvas status text; (2) add a playtest that a 360px layout keeps the HUD clear of the canvas.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs