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

Migrated from github.com/amirmushichge/pixel-plays

Add Bird Watch: the playable page and its place in the catalogue, on the rules in `bird-watch/watch.js` #211

Parked opened this
Closed without merging

Bird Watch is now a playable page at /bird-watch/, built only on bird-watch/watch.js, and it is in the catalogue. The pull is rebased on current main. I ran the playtest, serve, shell and town suites on the branch, and the playtest for bird-watch again after the rebase.

Notes

stopped parked by the crew

opened this

Bird Watch is now a playable page at /bird-watch/, built only on bird-watch/watch.js, and it is in the catalogue. The pull is rebased on current main.

I ran the playtest, serve, shell and town suites on the branch, and the playtest for bird-watch again after the rebase. All passed. I ran serve, shell and town once more after the rebase and they also passed. I did not run a bare bun test over everything, because the forge runs the full check on push. There is no scripts/gate.ts in this clone, and tsc has no tsconfig here, so neither ran.

What it does

  • The garden: an oak, a fence, a shed roof and a bird feeder, 360x280 on the shared engine, drawn with hard shadows screen-right. Birds fly in one by one, sit, then fly off.
  • The question: each question names a bird, shown in the status line and as a large bird on a stone plinth at the front-left of the garden.
  • Species: each of the 8 species differs in silhouette, not only colour. The owl is upright and eared, the jay crested, the magpie long-tailed, the wren cocked-tailed, the finch forked, the starling long-beaked, the sparrow plump, the robin round.
  • Answering: tap a perch, or move a cursor with the arrow keys and confirm with Space or Enter. Afterwards the true perch is ringed and the status line names it. Tap or any key restarts after the end.
  • HUD and rules: it shows the round, answers right and binoculars left, read from the rules state. The rules popup is four lines and there is a #mute button. The canvas aria-label says how to play. No .mp3 is committed.
  • Rules only: the page adds no game rule. Landing, hold and reveal timings are presentation only.
  • Motion: only the oak leaves stir, and that stops under prefers-reduced-motion. The birds' flight is play and still moves.
  • Catalogue: the GAMES entry is as specified in the issue. It also has the root <li>, the README Games row, the no-music list and the ambient-motion note, and bun scripts/og.mjs has been run. The town builds from GAMES, so no change to town.js was needed.
  • Tests: rounds.mjs has a scripted round that taps the asked perch every time. It wins in about 50 simulated seconds with "Sharp eyes: 5 rounds cleared, 20 answers right". serve.test.mjs asserts /bird-watch/ and /bird-watch/watch.js answer 200.

What I chose not to do: no grass tufts or other ambient animation, since the issue allows only leaves. No persistence, since the rules have no save.

To try it, run bun run src/server.ts or open the preview, then go to /bird-watch/.

Closes #181

5 earlier comments · 5 events
commented

Bird Watch is now a playable page at /bird-watch/, built only on bird-watch/watch.js, and it is in the catalogue. The pull is rebased on current main.

I ran the playtest, serve, shell and town suites on the branch, and the playtest for bird-watch again after the rebase. All passed. I ran serve, shell and town once more after the rebase and they also passed. I did not run a bare bun test over everything, because the forge runs the full check on push. There is no scripts/gate.ts in this clone, and tsc has no tsconfig here, so neither ran.

What it does

  • The garden: an oak, a fence, a shed roof and a bird feeder, 360x280 on the shared engine, drawn with hard shadows screen-right. Birds fly in one by one, sit, then fly off.
  • The question: each question names a bird, shown in the status line and as a large bird on a stone plinth at the front-left of the garden.
  • Species: each of the 8 species differs in silhouette, not only colour. The owl is upright and eared, the jay crested, the magpie long-tailed, the wren cocked-tailed, the finch forked, the starling long-beaked, the sparrow plump, the robin round.
  • Answering: tap a perch, or move a cursor with the arrow keys and confirm with Space or Enter. Afterwards the true perch is ringed and the status line names it. Tap or any key restarts after the end.
  • HUD and rules: it shows the round, answers right and binoculars left, read from the rules state. The rules popup is four lines and there is a #mute button. The canvas aria-label says how to play. No .mp3 is committed.
  • Rules only: the page adds no game rule. Landing, hold and reveal timings are presentation only.
  • Motion: only the oak leaves stir, and that stops under prefers-reduced-motion. The birds' flight is play and still moves.
  • Catalogue: the GAMES entry is as specified in the issue. It also has the root <li>, the README Games row, the no-music list and the ambient-motion note, and bun scripts/og.mjs has been run. The town builds from GAMES, so no change to town.js was needed.
  • Tests: rounds.mjs has a scripted round that taps the asked perch every time. It wins in about 50 simulated seconds with "Sharp eyes: 5 rounds cleared, 20 answers right". serve.test.mjs asserts /bird-watch/ and /bird-watch/watch.js answer 200.

What I chose not to do: no grass tufts or other ambient animation, since the issue allows only leaves. No persistence, since the rules have no save.

To try it, run bun run src/server.ts or open the preview, then go to /bird-watch/.

Changes requested — before the latest push

Bird Watch serves (200 on the preview) and the rules, catalogue, README, og card and playtest round are all in place. I could not open the phone or desktop screenshots because the file tools are confined to the clone, so this review is from the diff and the served page. Four changes, all in bird-watch/index.html, to fix in one round:

  1. Dead code. G.result and G.end are assigned and never read, and G.event is only a relay for one branch. Remove G.result and G.end. const spot = perch => SPOT[perch] only wraps SPOT: use SPOT[...] directly. LOOK.owl.owl = true patched in after the table is a hack: put owl: true in the owl entry.
  2. Legibility. The HUD labels, the status line and the mute button use --muted: #8b877f on white, about 3.5:1, below the 4.5:1 that 13px text needs. The status line carries the question "Where did the X sit?" and the result, so it must be readable on a phone in daylight. Darken the muted text colour to about #6b675f or darker.
  3. Touch targets. The mute button has a 10px padding and a -10px margin, so a thumb gets about 33px square, under the 44px minimum. Enlarge its padding to reach 44px, and keep it clear of the canvas bottom edge.
  4. Rules text. The tap reach on a perch (nearest, 24 canvas px with a 1.4 vertical stretch) is not tested by anything but the scripted playtest, which taps the exact point. Either add a short note to the pull on how the miss-tap ("tap a perch") was tried, or add a test for it.

Next after these, nothing blocking: a visible keyboard hint near the status line, and a line in the aria-live status when the flock has finished landing so a screen-reader user knows the question is coming.

commented

All four changes are in, and the tests I ran pass. I ran bun test bird-watch (12 pass) and the bird-watch playtest. I did not re-run the full suite; the forge's check does that on push. I have not looked at the page again in a browser. The earlier push (d98281f) left one new test failing; it is fixed in 5d98220.

  1. Dead code: I removed G.result and G.end, and the spot wrapper (the page now reads SPOT[...]). owl: true is now in the owl entry. I kept G.event, since you only asked for the other two to go.
  2. Legibility: --muted is now #6b675f, which affects the HUD labels, the status line and the mute button.
  3. Touch target: the mute button now has min-height: 44px and 13px vertical padding. The bottom HUD sits at least 20px up from the screen edge, so the button stays clear of it.
  4. Tap reach: I added bird-watch/page.test.mjs with three tests:

- a tap about 7px off a perch still picks that perch; - a tap far from every perch answers nothing and says "tap a perch"; - an arrow key moves the cursor and Space answers with it.

Writing the reach test found a real problem. oak-high and oak-tip were only 9px apart on screen, so one was nearly untappable and the two birds overlapped. I moved both: they are now 25px apart. Every pair of perches is at least 23px apart.

I also made the status line carry a hint when the question opens: "Where did the X sit? Tap a perch, or arrows and Space". That covers your two non-blocking items, since the status line is the aria-live region and the hint is visible on screen.

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

I merged main into this branch and pushed it. The pull should merge cleanly again.

The tsc run had not finished when I stopped, so the type check is unconfirmed.

  • README: README.md came out of the merge with no conflict markers and both sides' text in it, so I kept it as it was. It lists both Curling Rink (from main) and Bird Watch in the catalogue.
  • og/home.png: this was the only real conflict, since both sides had changed the generated collage. I regenerated it with bun scripts/og.mjs so it includes both games.
  • Tests: serve.test.mjs and the Bird Watch and Curling tests pass (105 tests, 0 failures). I did not run the full suite here; the forge's check runs it on this push.

Bird Watch is unchanged by the merge: the playable page at bird-watch/, its entry in the catalogue and og/bird-watch.png, on the rules in bird-watch/watch.js.

commented

Bird Watch is on its own page and in the catalogue, and the full suite passes locally. I merged main into the branch and pushed.

What went wrong: the deploy log you sent was cut off mid-run, during the Bell Tower playtest, with no failure line. I ran the whole suite on the branch before merging: 1213 pass, 0 fail, but it took about 587 seconds. So the preview deploy most likely hit a time limit rather than a failing test. I didn't change any code for that. If the new preview times out again, the suite's length is the cause. Most of the time is in playtest.test.mjs, which runs five scripted rounds for each of the roughly 60 games.

What changed in the merge: main had gained Bunting (#214), which conflicted with this branch in README.md, index.html and shell.js.

  • Catalogue: both games are listed, in GAMES and in the no-JS fallback list.
  • README: the list of games with no music now includes both Bird Watch and Bunting. The ambient-motion list keeps both games' sentences.
  • Share cards: I regenerated og/home.png and the other cards with bun scripts/og.mjs.

What I checked after the merge: serve.test.mjs, shell.test.mjs, town.test.mjs and stats.test.mjs pass (106 tests). The playtests for Bird Watch and Bunting also pass. I did not rerun the whole suite after the merge, and I did not run bun x tsc --noEmit or scripts/gate.ts. Only scripts/og.mjs exists in scripts/, so there is no gate.ts to run.

To try it: open /bird-watch/, or tap Bird Watch in the home list.

Approved — before the latest push

Earlier asks are met: dead code (G.result, G.end, spot wrapper) is gone, --muted is #6b675f, the mute button has a 44px target, and page.test.mjs covers tap reach and keyboard. The oak-high and oak-tip perches are no longer overlapping. The page answers 200 on the preview, the catalogue, README and og cards are in place, and the page adds no rule beyond watch.js. I could not diff against 0b988aac67d6 because the clone lacks that commit, so I read the full change. Next: (1) Non-blocking: add a no-JS line that names the game, which today is only a noscript notice. (2) Non-blocking: give the aria-live status a separate polite announcement for the reveal result, so screen readers hear Yes/No without the hint text.

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

Bird Watch adds nothing red that I can find, and I changed no code this turn. The deploy log you sent stops partway through the playtest suite, at bell-tower, with no failing test in it.

I ran the pieces locally:

  • Whole playtest suite: bun test playtest.test.mjs passes, 292 of 292. It took about 9 minutes here, which I suspect is what the deploy ran out of time on, though the cut-off log doesn't say.
  • Bird Watch tests: its own tests and its playtest rounds pass.
  • Other suites touched: shell, serve, plaza, town and stats tests pass (124 across 7 files).
  • Type check: I ran bun x tsc --noEmit and it printed only an options/help banner, which I didn't investigate.

The branch is already merged with main and has nothing uncommitted. git push says "Everything up-to-date", so there is nothing new to land, and the forge has to re-run the deploy on the existing commit. The tracking ref shows as [gone], so the remote branch may have been deleted.

I did not shorten the suite or touch the playtest file. If the deploy has a time limit, the playtest suite needs speeding up, and that is a change for a separate pull.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs