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

Migrated from github.com/amirmushichge/pixel-plays

Add Bread Oven: slide loaves into a wood-fired oven and pull each one out golden #54

Merged opened this

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

Merged

Bread Oven is added at /bread-oven/, and the listing and tests are updated. bun test on the oven rules, serve.test.mjs and shell.test.mjs passes (48 tests). I did not run the full suite.

Notes

shipped production is serving it deploy ab54f53

opened this

Bread Oven is added at /bread-oven/, and the listing and tests are updated. bun test on the oven rules, serve.test.mjs and shell.test.mjs passes (48 tests). I did not run the full suite. I haven't played it in a browser. I checked the look by rendering frames offline, and the keyboard, tap and animation code is untested.

  • Rules: bread-oven/oven.js holds everything: four slots with bake rates 1.5, 1.15, .85 and .6 (slot 1 is nearest the fire), and crust stages at 6, 10 and 13 bake-seconds. Golden is worth 3, dark 1, pale 0, and burnt adds a strike. A round is 60 seconds or three strikes. The counter starts with 2 loaves, gains one every 4 seconds, and holds at most 3.
  • Tests: oven.test.mjs has 10 tests. They cover a near-fire slot reaching golden sooner, scoring 3 for golden, a burnt loaf adding a strike, three strikes ending the round, and an empty slot not being pullable. They also check bad input.
  • Page: The canvas is 360x280 on white. It shows the brick oven with four arched slots and a firebox at the left end, a counter, a peel that follows the chosen slot, a cooling rack, a flour sack and a log pile. Smoke curls from the chimney.
  • Input: Arrow keys (or A/D) pick a slot, space slides a loaf in, and enter pulls it out. A tap on a slot pulls its loaf if it has one and slides one in if it's empty. A tap anywhere else slides a loaf into the chosen slot, and a tap after the round ends starts the next one.
  • Colour-blind reading: The four crust stages differ by colour, by marks on the loaf (none, one slash, two slashes, a cross-hatch), and by 1–4 pips above each slot. The status line also names the stage.
  • Reduced motion: Smoke, fire flicker, embers and the arrow bob all freeze under prefers-reduced-motion.
  • Wiring: The game is in GAMES (forged: true, music: false), the home-page list, and the README Games table. serve.test.mjs checks that the page and its script answer 200. The page has #mute and no .mp3. The rules popup is three lines. I ran bun scripts/og.mjs, so the share card and meta tags are committed.

I added no dependencies, and no sound files. bun scripts/design-lint.ts doesn't exist in this repository, so I couldn't run it.

To try it, run bun serve.mjs and open /bread-oven/. The preview deploys from this branch.

🤖 Generated with Claude Code

Closes #39

3 earlier comments · 2 events
commented

Bread Oven is added at /bread-oven/, and the listing and tests are updated. bun test on the oven rules, serve.test.mjs and shell.test.mjs passes (48 tests). I did not run the full suite. I haven't played it in a browser. I checked the look by rendering frames offline, and the keyboard, tap and animation code is untested.

  • Rules: bread-oven/oven.js holds everything: four slots with bake rates 1.5, 1.15, .85 and .6 (slot 1 is nearest the fire), and crust stages at 6, 10 and 13 bake-seconds. Golden is worth 3, dark 1, pale 0, and burnt adds a strike. A round is 60 seconds or three strikes. The counter starts with 2 loaves, gains one every 4 seconds, and holds at most 3.
  • Tests: oven.test.mjs has 10 tests. They cover a near-fire slot reaching golden sooner, scoring 3 for golden, a burnt loaf adding a strike, three strikes ending the round, and an empty slot not being pullable. They also check bad input.
  • Page: The canvas is 360x280 on white. It shows the brick oven with four arched slots and a firebox at the left end, a counter, a peel that follows the chosen slot, a cooling rack, a flour sack and a log pile. Smoke curls from the chimney.
  • Input: Arrow keys (or A/D) pick a slot, space slides a loaf in, and enter pulls it out. A tap on a slot pulls its loaf if it has one and slides one in if it's empty. A tap anywhere else slides a loaf into the chosen slot, and a tap after the round ends starts the next one.
  • Colour-blind reading: The four crust stages differ by colour, by marks on the loaf (none, one slash, two slashes, a cross-hatch), and by 1–4 pips above each slot. The status line also names the stage.
  • Reduced motion: Smoke, fire flicker, embers and the arrow bob all freeze under prefers-reduced-motion.
  • Wiring: The game is in GAMES (forged: true, music: false), the home-page list, and the README Games table. serve.test.mjs checks that the page and its script answer 200. The page has #mute and no .mp3. The rules popup is three lines. I ran bun scripts/og.mjs, so the share card and meta tags are committed.

I added no dependencies, and no sound files. bun scripts/design-lint.ts doesn't exist in this repository, so I couldn't run it.

To try it, run bun serve.mjs and open /bread-oven/. The preview deploys from this branch.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed it. The merge is clean again, and serve.test.mjs, shell.test.mjs and the Bread Oven tests pass (49 tests). I did not run the full suite; the forge's check will do that.

The conflicts were all one-line collisions with the new Campfire game, and I kept both games in each place:

  • shell.js, index.html, README.md: the Campfire entry now sits before Bread Oven. I also added Bread Oven to the README list of games that play on their own sound effects.
  • serve.test.mjs: both the Campfire and Bread Oven "served without a track" tests are in.
  • og/home.png: I regenerated the home share card with bun scripts/og.mjs, so it includes both games, and the card tests pass against it.

No game code changed, and the description of #54 still applies as written.

Changes requested — before the latest push

Bread Oven is a good fit for the direction. It's a new game, labelled forged by the crew, and listed in GAMES, the no-JS list and the README. The rules live in a tested plain module. On the preview, /, /bread-oven/, oven.js and the OG card all answer 200, and the home page links to the game. There is no server code, terminal or input boundary to review, and play counting comes from the shell. Two things block it.

Fix first: dead code. These are defined and never used:

  • running in oven.js is just s => s.score, and nothing calls it.
  • rateOf and STAGES are exported, but neither the page nor the tests use them.
  • G.keys: new Set() in the page is never read. It was copied from Orchard.
  • The page destructures ROUND_TIME, MAX_STRIKES and COUNTER_MAX and never uses them.

Remove them. If you want to keep rateOf, give it a test.

Second: a pulled loaf can disappear. act() replaces G.fly on every pull. If two loaves are pulled within 0.35 s (tap one slot, then another), the first one never lands on the cooling rack. Keep a list of loaves in flight, or push the earlier one to the rack before starting the next.

If you change the page, rerun bun scripts/og.mjs so the card and its tags stay current.

Changes requested — before the latest push

Round 2. Since be14d80 the only change is the merge of main. Campfire and Bread Oven both sit in shell.js, index.html, the README and serve.test.mjs, and og/home.png was regenerated. The merge is fine. On the preview at this head, /, /bread-oven/, /bread-oven/oven.js and /og/bread-oven.png all answer 200.

Neither ask from my last review is met. The game code is byte-for-byte what I read before:

  1. Dead code: not met. Fix this first. running (oven.js:41, exported at :94) is still unused. rateOf and STAGES are still exported and nothing uses them. G.keys: new Set() (index.html:85) is never read. ROUND_TIME, MAX_STRIKES and COUNTER_MAX are still destructured at index.html:68 and never used. Delete all of them, or give rateOf a test if you keep it.
  2. A pulled loaf can vanish: not met. act() still overwrites the single G.fly (index.html:302). If two loaves are pulled within 0.35 s, the first never reaches the rack. Either keep an array of loaves in flight and land each one in update(), or push the current G.fly.stage onto the rack before starting the next flight.

After changing the page, rerun bun scripts/og.mjs and bun test bread-oven/oven.test.mjs serve.test.mjs. This is the last round of changes; anything left after it becomes an issue.

commented

Adds Bread Oven (#39), a new forged game. It's a brick oven with four slots, a firebox at the left end, a counter of dough, a peel, a cooling rack and a flour sack, on white. Loaves brown from pale to golden to dark to burnt, faster in the slots nearer the fire. Pulling a loaf scores golden 3, dark 1, pale 0, and a burnt loaf is a strike. A round lasts 60 seconds or three strikes.

Rules. The rules live in bread-oven/oven.js: plain data in and out, no DOM. bread-oven/oven.test.mjs covers them:

  • a slot near the fire reaches golden sooner;
  • golden scores 3, dark 1, pale 0;
  • a burnt loaf adds a strike, and three strikes end the round;
  • an empty slot can't be pulled, and a full slot can't take a second loaf;
  • dough arrives on a timer up to a cap;
  • the round ends at 60 seconds and restarts;
  • bad time steps and slot numbers are ignored.

Page. bread-oven/index.html is built on the shared engine and shell.

  • Controls: arrows pick a slot, space slides a loaf in, enter pulls it out. Tapping a slot pulls its loaf, or slides one in if it is empty.
  • Telling crusts apart: each crust stage changes colour, adds marks (none, one slash, two slashes, a cross-hatch) and fills 1 to 4 pips above the slot, so colour-blind players can read them.
  • Reduced motion: smoke, fire flicker and embers stop under prefers-reduced-motion.
  • Fast pulls: each pulled loaf flies to the rack on its own, so two quick pulls both land.
  • Accessibility and sound: the canvas aria-label explains how to play, the rules popup is three lines, and there is a #mute button with no .mp3.

Listing. The game is in GAMES in shell.js, the no-JS list in index.html and the README Games table. serve.test.mjs checks that /bread-oven/ and oven.js answer 200. The share card og/bread-oven.png, the regenerated og/home.png and the page's meta tags come from bun scripts/og.mjs. main is merged in, and Campfire and Bread Oven both stay listed.

Review changes. This round removes the unused running, rateOf and STAGES exports, the unused G.keys and the unused page constants. It also fixes the bug where a quick second pull made the first loaf vanish.

bun test bread-oven/oven.test.mjs serve.test.mjs passes. No dependencies were added. scripts/design-lint.ts does not exist in this repository, so the design lint was not run.

To try it: run bun serve.mjs and open /bread-oven/, or use this pull's preview.

🤖 Generated with Claude Code

commented

Adds Bread Oven (#39), a new forged game. It's a brick oven with four slots, a firebox at the left end, a counter of dough, a peel, a cooling rack and a flour sack, on white. Loaves brown from pale to golden to dark to burnt, faster in the slots nearer the fire. Pulling a loaf scores golden 3, dark 1, pale 0, and a burnt loaf is a strike. A round lasts 60 seconds or three strikes.

Rules. The rules live in bread-oven/oven.js: plain data in and out, no DOM. bread-oven/oven.test.mjs covers them:

  • a slot near the fire reaches golden sooner;
  • golden scores 3, dark 1, pale 0;
  • a burnt loaf adds a strike, and three strikes end the round;
  • an empty slot can't be pulled, and a full slot can't take a second loaf;
  • dough arrives on a timer up to a cap;
  • the round ends at 60 seconds and restarts;
  • bad time steps and slot numbers are ignored.

Page. bread-oven/index.html is built on the shared engine and shell.

  • Controls: arrows pick a slot, space slides a loaf in, enter pulls it out. Tapping a slot pulls its loaf, or slides one in if it is empty.
  • Telling crusts apart: each crust stage changes colour, adds marks (none, one slash, two slashes, a cross-hatch) and fills 1 to 4 pips above the slot, so colour-blind players can read them.
  • Reduced motion: smoke, fire flicker and embers stop under prefers-reduced-motion.
  • Fast pulls: each pulled loaf flies to the rack on its own, so two quick pulls both land.
  • Accessibility and sound: the canvas aria-label explains how to play, the rules popup is three lines, and there is a #mute button with no .mp3.

Listing. The game is in GAMES in shell.js, the no-JS list in index.html and the README Games table. serve.test.mjs checks that /bread-oven/ and oven.js answer 200. The share card og/bread-oven.png, the regenerated og/home.png and the page's meta tags come from bun scripts/og.mjs.

Merge with main. Campfire and Beekeeper from main stay listed next to Bread Oven everywhere, and the README's "add a game" paragraph now names Bread Oven among the games without a music track.

Review changes. Removes the unused running, rateOf and STAGES exports, the unused G.keys and the unused page constants. Fixes the bug where a quick second pull made the first loaf vanish.

bun test serve.test.mjs shell.test.mjs bread-oven passes. No dependencies were added. scripts/design-lint.ts does not exist in this repository, so the design lint was not run.

To try it: run bun serve.mjs and open /bread-oven/, or use this pull's preview.

🤖 Generated with Claude Code

Approved

All five asks from the last round (head be14d80) are met:

  • running is deleted from oven.js, and STAGES and rateOf are gone from the export. The live oven.js on the preview has none of them.
  • The page now destructures only SLOTS from Oven.
  • G.keys is removed.
  • A quick second pull no longer loses a loaf. G.flying is now a list, each loaf flies on its own, they land in order in update, and the rack slot is picked from rack.length + flying.length.

On the preview at this head, /, /bread-oven/, oven.js and og/bread-oven.png all return 200, the home list links the game, and nosniff and no-referrer are on the responses. The 10 rules tests pass against the preview's oven.js. The change touches no server, write path or terminal, and adds no dependency.

Non-blocking: the in-flight list is page code, so no test covers it. If more games need the same thing, a small rack helper in a plain script with a test beside it would pin this behaviour down.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs