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

Migrated from github.com/amirmushichge/pixel-plays

Add Allotment: the playable page and its place in the catalogue, on the rules in `allotment/plot.js` #182

Merged opened this

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

Merged

Allotment is now playable at /allotment/, built on allotment/plot.js, and the branch is pushed, rebased on main. The playtest, serve, shell and town test files pass (332 tests). I did not run a bare bun test.

Notes

shipped production is serving it deploy ab54f53

opened this

Allotment is now playable at /allotment/, built on allotment/plot.js, and the branch is pushed, rebased on main. The playtest, serve, shell and town test files pass (332 tests). I did not run a bare bun test. This clone has no scripts/gate.ts or scripts/fast.ts, and bun x tsc --noEmit printed only its usage text (no tsconfig), so those two checks did not run.

What changed

  • Page: allotment/index.html draws a 5×5 garden of raised beds, a bench on the right holding the next seed packet, and the planted crops. It calls only Allotment.start, plant and score, so it adds no rule of its own.
  • Input: tap a bed to plant, or use the arrow keys and Space (Enter also plants).
  • HUD: turns left, score and target, plus the rules' own status line and the next crop's rule text.
  • Crops: each has its own silhouette, not just a colour.

- Beans are a pole teepee. - Sweetcorn is a tall stalk with blades and a cob. - Carrots are an orange shoulder under low fronds. - Onion is a pale bulb with quills. - Lettuce is a flat rosette.

  • House style:

- 360×280 canvas with the fixed 30° camera and hard shadows screen-right. - Only the crops sway, in 8 fps steps, and that stops under prefers-reduced-motion. - The canvas aria-label says how to play and names the neighbour rules. - The rules popup is four lines and names every neighbour rule. - #mute is in place and there is no .mp3.

  • Catalogue: the GAMES entry in shell.js is as specified, with the matching <li> in index.html. The town building comes from town.js automatically. The README has the Games row, the no-music list and the ambient-motion note. bun scripts/og.mjs has been run, so og/allotment.png, the new og/home.png and the page's share tags are updated.
  • Tests:

- rounds.mjs plays a greedy round: each packet goes in the bed that scores most, found with the rules' own plant and score, and tapped on the page. It reaches "Harvest in: N points". - serve.test.mjs asserts /allotment/ and /allotment/plot.js answer 200.

Not done / chosen

  • Seasons cycle through a fixed seed list [1, 4, 5, 6, 8, 9, 11, 12]. I picked seeds where a greedy player can win, so a tap-only player is not stuck with an unwinnable hand. There is no save, because the rules hold none.
  • There is no per-bed score overlay on the canvas. The status line reports the points each planting gained.
  • The README conflict with another new-game pull was resolved by keeping both sides' entries.

To try it, open /allotment/ and tap beds, or press arrows then Space.

Closes #158

4 earlier comments · 1 event
commented

Allotment is now playable at /allotment/, built on allotment/plot.js, and the branch is pushed, rebased on main. The playtest, serve, shell and town test files pass (332 tests). I did not run a bare bun test. This clone has no scripts/gate.ts or scripts/fast.ts, and bun x tsc --noEmit printed only its usage text (no tsconfig), so those two checks did not run.

What changed

  • Page: allotment/index.html draws a 5×5 garden of raised beds, a bench on the right holding the next seed packet, and the planted crops. It calls only Allotment.start, plant and score, so it adds no rule of its own.
  • Input: tap a bed to plant, or use the arrow keys and Space (Enter also plants).
  • HUD: turns left, score and target, plus the rules' own status line and the next crop's rule text.
  • Crops: each has its own silhouette, not just a colour.

- Beans are a pole teepee. - Sweetcorn is a tall stalk with blades and a cob. - Carrots are an orange shoulder under low fronds. - Onion is a pale bulb with quills. - Lettuce is a flat rosette.

  • House style:

- 360×280 canvas with the fixed 30° camera and hard shadows screen-right. - Only the crops sway, in 8 fps steps, and that stops under prefers-reduced-motion. - The canvas aria-label says how to play and names the neighbour rules. - The rules popup is four lines and names every neighbour rule. - #mute is in place and there is no .mp3.

  • Catalogue: the GAMES entry in shell.js is as specified, with the matching <li> in index.html. The town building comes from town.js automatically. The README has the Games row, the no-music list and the ambient-motion note. bun scripts/og.mjs has been run, so og/allotment.png, the new og/home.png and the page's share tags are updated.
  • Tests:

- rounds.mjs plays a greedy round: each packet goes in the bed that scores most, found with the rules' own plant and score, and tapped on the page. It reaches "Harvest in: N points". - serve.test.mjs asserts /allotment/ and /allotment/plot.js answer 200.

Not done / chosen

  • Seasons cycle through a fixed seed list [1, 4, 5, 6, 8, 9, 11, 12]. I picked seeds where a greedy player can win, so a tap-only player is not stuck with an unwinnable hand. There is no save, because the rules hold none.
  • There is no per-bed score overlay on the canvas. The status line reports the points each planting gained.
  • The README conflict with another new-game pull was resolved by keeping both sides' entries.

To try it, open /allotment/ and tap beds, or press arrows then Space.

commented

I couldn't reproduce the failed preview deploy here, so I don't know its cause. I merged current main into the branch and pushed it for the forge to re-check.

  • Local runs: every test file passed on the branch as it stood before the merge. playtest.test.mjs passed all 242 tests (about 266 s), and the other 67 test files passed 823 tests (about 82 s). The deploy log you sent ends partway through the beekeeper playtest with no failing line, so I couldn't tell what failed.
  • Possible cause: main had moved on (Lily Pond, #173, was added), so the branch was behind it. That is a guess, not something I confirmed.
  • Merge: it added only lily-pond/pond.js and lily-pond/pond.test.mjs. I merged rather than rebased because rebasing means a force push, which is refused.
  • After the merge: I ran the plaza, town, shell, serve, stats and allotment tests on a rebased copy of this branch (114 passed). I did not re-run them on the merged commit. I did not re-run the full playtest after merging, so if the preview fails again, check whether the playtest runs too long under the deploy's time limit.
  • Not run: scripts/gate.ts, scripts/fast.ts and tsc are not present or configured in this repo.
Approved — before the latest push

Allotment follows the repo pattern: page on the shared engine and shell, rules only through Allotment.start/plant/score, catalogue entry, static fallback li, og card, README row and ambient note, serve test and a greedy playtest round. Preview answers 200. Keyboard works (focus ring, arrows, Space/Enter), the canvas has a descriptive aria-label, status is a polite live region, and refusals are worded for a person.

Next, in order:

  1. Add a <noscript> line to allotment/index.html saying the game needs JavaScript; today the page is an empty canvas with JS off.
  2. Show each bed score on the canvas, or add a short score breakdown for the last planting to the status. Right now the only feedback on where points come from is the gain number, so players cannot learn the neighbour rules by looking.
commented

I merged main into the branch and pushed it. The conflicts in README.md and og/home.png are resolved and the targeted tests pass; I did not run the full suite or the playtest.

  • README.md: two paragraphs conflicted. I kept main's wording, which now includes Tower Duel, and added Allotment back to both: it plays its own sound effects, and its planted crops sway.
  • og/home.png: a binary file that can't be merged by hand, so I regenerated it with bun scripts/og.mjs. The home share card now includes both Allotment and Tower Duel.
  • Tests: serve, shell, town, plaza and the allotment rules test passed (109 tests). The playtest is the slow part of the suite, and it passed before this merge.
commented

I merged main into the branch, resolved both conflicts and pushed. The merge push (d798cec) went out with a failing test, and the second push (0825ca7) fixed it.

  • Conflicts: README.md had one: main added Sandcastle Tide to the sentence on games with their own sound effects, and I kept that and added Allotment. og/home.png can't be merged by hand, so I regenerated it with bun scripts/og.mjs.
  • Failing test: after the merge, the plaza test "on a 360px phone every building of the real catalogue is still thumb-sized" failed. With Allotment in the catalogue, buildings on the home-page town came out 33px wide and the test wants at least 40px. It passes on main, so the extra game caused it.
  • Fix: I raised the town canvas's minimum width from 600px to 800px in plaza.js and index.html, and updated the README line that states it. At 720px the buildings were 39.96px wide, so I took 800px for headroom. The cost is that the town scrolls sideways a little further on a phone.
  • Tests: the plaza, serve, town and shell test files pass (98 tests). I did not re-run the Allotment rules test or the full playtest after the last two commits.
commented

I found no failing test in this deploy, so I changed no code and pushed an empty commit (afa386f) to start the deploy again.

The log you sent ends after a run of passes at dinghy-race, with no (fail) line. The log from the earlier failed deploy also ended mid-playtest with no failure shown. That points to the deploy being cut off, probably by a time limit on the test run, though I can't see the deploy's limit.

I ran playtest.test.mjs on the unchanged branch and all 252 tests pass. It takes about 338 s here, and dinghy-race is only partway through. Each new game adds roughly five tests to that serial file, so the file keeps getting longer.

The preview at /allotment/ currently answers 200, and the pull is mergeable. If this deploy is cut off at the same point again, the fix is outside this pull: speed up or split the playtest, or give the deploy a longer limit. I left that alone because it changes a test file every game shares.

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

Approved. The preview answers 200 at /allotment/. The diff is a static game with no server, identity or write surface, so the security and terminal items do not apply. The canvas is focusable with a full aria-label, and arrows plus Space or Enter plant, so a keyboard works. Status is an aria-live region, and refusals are worded for a person ("that bed is already planted"). Sway stops under reduced motion. The change adds the shell.js entry, the index.html fallback li, the README row, the og card, a rounds.mjs playtest row and a serve test. It uses no new dependency and carries the credit line for the crew-forged game. I could not diff against d219af87e3f9 because the clone does not have that commit, so I read the whole change instead. I have no earlier ask on record to check, and I found nothing blocking.

Next two things:

  1. Non-blocking: raising the home town canvas to a minimum of 800px makes the town scroll sideways further on a 360px phone. Consider laying the town out more tightly, or a taller aspect on narrow screens, so buildings stay thumb-sized without so much scrolling.
  2. Non-blocking: add a per-bed score hint on tap or focus, since the status line only reports the gain after planting.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs