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

Migrated from github.com/amirmushichge/pixel-plays

Add Curling Rink: the playable page and its place in the catalogue, on the rules in `curling/rink.js` #210

Merged opened this

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

Merged

Curling Rink now has its playable page at /curling/ and its place in the catalogue, built only on curling/rink.js. The playtest for the folder and serve.test.mjs pass, along with town.test.mjs. I did not run the whole suite.

Notes

shipped production is serving it deploy ab54f53

opened this

Curling Rink now has its playable page at /curling/ and its place in the catalogue, built only on curling/rink.js. The playtest for the folder and serve.test.mjs pass, along with town.test.mjs. I did not run the whole suite. scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone, and bun x tsc --noEmit found no tsconfig, so none of those ran.

  • Page: curling/index.html draws the sheet, the house rings, both teams' stones and the sweeper from the rules' state, and adds no rule of its own.

- Aim and throw: drag back from the hack to set power, and the tilt of the drag sets curl. - Sweep: hold anywhere, or Space, while the stone runs. - HUD: stones left and the points the rules would score now.

  • Visual rules: it uses the fixed 30-degree camera on the 360x280 canvas, and the shadows fall screen-right.

- Stones: yours have a tall post with a knob; the opponent's have a flat bar across. - Ambient motion: the crowd breathes and the ice glints, and both stop under prefers-reduced-motion. - Page chrome: the rules popup is four lines, the canvas aria-label says how to play, there is a #mute button, and no .mp3 is committed.

  • Catalogue: the GAMES entry in shell.js is exactly as the issue gives it, with the matching <li> in the root index.html. The README Games table, no-music list and ambient-motion list name it. The town needs no edit because town.js builds its buildings from GAMES. bun scripts/og.mjs has been run, so og/curling.png, og/home.png and the page's share tags are made.
  • Tests: rounds.mjs has a scripted round for curling that reaches the end line. serve.test.mjs asserts that /curling/ and /curling/rink.js answer 200.

I added a keyboard route, which the issue didn't ask for. Left/Right aim, Up/Down curl, hold Enter to charge and release to throw, Space to sweep. The README describes it.

The scripted round has limit: 240, because a stone takes about 18 s to slide and eight of them overrun the default 150 s.

Stones are drawn about 2.5 times their real size, or they would be specks on a 38 m sheet; the collisions still use the rules' sizes.

The branch was already up to date with origin/main when I pushed.

Closes #179

2 earlier comments · 1 event
commented

Curling Rink now has its playable page at /curling/ and its place in the catalogue, built only on curling/rink.js. The playtest for the folder and serve.test.mjs pass, along with town.test.mjs. I did not run the whole suite. scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone, and bun x tsc --noEmit found no tsconfig, so none of those ran.

  • Page: curling/index.html draws the sheet, the house rings, both teams' stones and the sweeper from the rules' state, and adds no rule of its own.

- Aim and throw: drag back from the hack to set power, and the tilt of the drag sets curl. - Sweep: hold anywhere, or Space, while the stone runs. - HUD: stones left and the points the rules would score now.

  • Visual rules: it uses the fixed 30-degree camera on the 360x280 canvas, and the shadows fall screen-right.

- Stones: yours have a tall post with a knob; the opponent's have a flat bar across. - Ambient motion: the crowd breathes and the ice glints, and both stop under prefers-reduced-motion. - Page chrome: the rules popup is four lines, the canvas aria-label says how to play, there is a #mute button, and no .mp3 is committed.

  • Catalogue: the GAMES entry in shell.js is exactly as the issue gives it, with the matching <li> in the root index.html. The README Games table, no-music list and ambient-motion list name it. The town needs no edit because town.js builds its buildings from GAMES. bun scripts/og.mjs has been run, so og/curling.png, og/home.png and the page's share tags are made.
  • Tests: rounds.mjs has a scripted round for curling that reaches the end line. serve.test.mjs asserts that /curling/ and /curling/rink.js answer 200.

I added a keyboard route, which the issue didn't ask for. Left/Right aim, Up/Down curl, hold Enter to charge and release to throw, Space to sweep. The README describes it.

The scripted round has limit: 240, because a stone takes about 18 s to slide and eight of them overrun the default 150 s.

Stones are drawn about 2.5 times their real size, or they would be specks on a 38 m sheet; the collisions still use the rules' sizes.

The branch was already up to date with origin/main when I pushed.

commented

I merged main into the branch, resolved the three conflicts, and pushed (7554cfd).

  • README.md: I took main's text and added Curling Rink back to the no-music list and the ambient-motion list. main adds Ferris Wheel to the no-music list, which now reads "Market Barrow, Curling Rink, Shunting Yard and Ferris Wheel".
  • rounds.mjs: Both scripted rounds are kept, curling and ferris-wheel.
  • og/home.png: I took main's file and regenerated it with bun scripts/og.mjs, so it includes both games. og/ferris-wheel.png came in with the merge.

I ran the playtests and serve.test.mjs, limited to the curling, Ferris Wheel, home-card and share-card tests. All 22 pass. I did not run the whole suite; the forge runs the full check on the push.

Changes requested — before the latest push

The page boots in the preview (/curling/ answers 200) and the catalogue, README, og card and scripted round are all in place. Two experience misses block it, both on the keyboard door; fix them in one round.

  1. (first) The canvas has outline: none and no focus style, so a keyboard player cannot see that the game has focus, nor the aim/curl/charge they are setting. Give canvas:focus-visible a visible outline, and show the current aim, curl and charge in the status line (e.g. "aim 1.5°, curl +0.25") so arrow-key play is legible without relying on the dotted line alone.
  2. The keyboard route is not discoverable: the rules popup and the visible page text never mention arrow keys, Enter or Space; only the long aria-label does. Add a rules line for the keys, and shorten the aria-label to what the canvas is and point to the rules.

Smaller: with JavaScript off the page is only a one-line noscript message; acceptable for a canvas game, but put it in a centred block that does not overlap the HUD. Also add a test for the keyboard route (aim clamp, Enter charge-release) in the scripted rounds or a page test, since the issue did not ask for it and it is otherwise untested.

commented

I've addressed both blocking points and the two smaller ones, and pushed (c803777). The new page test and the curling playtest pass; I did not run the full suite.

  • Focus: canvas:focus-visible now has a 2px accent outline, using the rule you suggested.
  • Status line: whenever aim or curl isn't at its default, the line reads like "7 of 8 stones left to throw · aim 1.5°, curl +0.25". While Enter is held it reads "charge 40%, aim …, curl …: release Enter to throw". Arrow and Enter presses clear any earlier note, so these values show straight away.
  • Rules and aria-label: the rules popup stays at four lines. To fit the keys line, I merged the old first two lines' content into tighter wording. Its third line is now "Keys: arrows aim and curl, hold Enter to charge and release to throw, Space sweeps." The aria-label is now short and says the rules list the keyboard controls.
  • No-JS: the noscript message sits in a centred block that no longer overlaps the HUD.
  • Test: curling/page.test.mjs covers the aim clamp at 5°, the curl clamp at ±1, and the status line text. It also checks that Enter charge-and-release throws at the expected power, and that a light tap of Enter throws nothing.

I also re-ran bun scripts/og.mjs, and it changed no files.

Approved

Earlier asks, all met at c803777: (1) keyboard focus is now visible (canvas:focus-visible has a 2px accent outline); (2) arrow/Enter state is readable on the status line (aim, curl, charge %), and curling/page.test.mjs would fail without it; (3) the aria-label is short and points to the rules for keys; (4) the noscript message no longer overlaps the HUD. The page is served, listed in the catalogue and the no-JS fallback, credits the crew as forger, and has a keyboard route as well as drag.

Two things I would do next, both Non-blocking:

  1. Add a screen-reader announcement when a stone stops and the score changes; the points counter updates silently outside the status region.
  2. Give the sweep a tap-and-hold affordance hint on phones (a first-run status line already says hold, but a visible sweeping state on the HUD would help thumbs).
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs