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

Migrated from github.com/amirmushichge/pixel-plays

Add Goalkeeper: dive left or right to save ten penalties in a village football ground #75

opened this

Merged 31d 5h ago, live in production

Goalkeeper is added as a new game: ten penalties on a village pitch, and you are in goal. bun test goalkeeper playtest.test.mjs serve.test.mjs shell.test.mjs passes (176 tests). I did not run bun test on the whole repo.

Notes

opened this

Goalkeeper is added as a new game: ten penalties on a village pitch, and you are in goal. bun test goalkeeper playtest.test.mjs serve.test.mjs shell.test.mjs passes (176 tests). I did not run bun test on the whole repo. The type check printed no errors but the repo has no tsconfig, so I'm not counting it. There is no scripts/gate.ts, scripts/fast.ts or scripts/design-lint.ts in this clone, so none of those ran.

  • Rules: goalkeeper/shootout.js holds them as plain data in and out. The shot comes from the seed (side and height). The tell window opens 1.0 s before the kick on penalty 1 and shrinks by 0.06 s per penalty. The ball takes 0.3 s to arrive.
    • Saves and goals: A dive to the shot side before the ball arrives saves. A wrong-side dive, a dive after arrival, or never moving concedes. Staying up (middle tap or Up) saves a shot down the middle.
    • Early dives: A dive before the window opens lets the taker switch to another side half the time.
    • End of round: Seven or more saves is a win, fewer is a loss. The tenth penalty ends the round. shootout.test.mjs covers each rule.
  • The tell: Before the window the taker runs up neutrally. Once it opens, a side shot shows as a body tilt, a sideways plant foot and the far arm flung wide. A shot down the middle shows as a crouch with both arms spread. I checked frames of the left lean at 4× zoom and it reads clearly; I did not review the right-side or centre lean frames. The rules popup says what the tells mean.
  • Scene: The pitch has chalk lines, a stone wall, a goal with a net, and a flag on the wall. Only the net and the flag move on their own, and both stop under prefers-reduced-motion. The people are drawn 1.2× larger than the goal would strictly allow, so the lean is readable at 360×280.
  • Input: Tap or click the left, middle or right of the canvas (thirds, split at 36% and 64%), or press Left, Right and Up. A tap after the result starts a new round.
  • Wiring: GAMES entry, home <li>, README table row, music-free list and serve.test.mjs are done, and bun scripts/og.mjs has been run. og/goalkeeper.png is new and og/home.png is regenerated. No .mp3 is committed. The page has #mute.
  • Tests: goalkeeper/page.test.mjs plays the page in the playtest harness: a save from reading the tell, a wrong-side dive, standing still, the keyboard, a full ten-save round with the saved best, and a loss line. The shared playtest.test.mjs passes for the new folder too.

Choices:

  • High or low shots change the drawn ball and the keeper's reach but not the rules. A dive to the right side saves either way.
  • Standing still concedes even a shot down the middle. Only an explicit middle tap or Up saves it.
  • No dependencies added.

To try it, open /goalkeeper/. Watch the taker from about 0.5 s into the run-up and tap the side they lean. Dive before they show it to see the switch.

An untracked set of dotfiles (.bashrc, .claude/ and others) was already in the clone; I did not commit them.

🤖 Generated with Claude Code

Closes #65

commented

Goalkeeper is added as a new game: ten penalties on a village pitch, and you are in goal. bun test goalkeeper playtest.test.mjs serve.test.mjs shell.test.mjs passes (176 tests). I did not run bun test on the whole repo. The type check printed no errors but the repo has no tsconfig, so I'm not counting it. There is no scripts/gate.ts, scripts/fast.ts or scripts/design-lint.ts in this clone, so none of those ran.

  • Rules: goalkeeper/shootout.js holds them as plain data in and out. The shot comes from the seed (side and height). The tell window opens 1.0 s before the kick on penalty 1 and shrinks by 0.06 s per penalty. The ball takes 0.3 s to arrive.
    • Saves and goals: A dive to the shot side before the ball arrives saves. A wrong-side dive, a dive after arrival, or never moving concedes. Staying up (middle tap or Up) saves a shot down the middle.
    • Early dives: A dive before the window opens lets the taker switch to another side half the time.
    • End of round: Seven or more saves is a win, fewer is a loss. The tenth penalty ends the round. shootout.test.mjs covers each rule.
  • The tell: Before the window the taker runs up neutrally. Once it opens, a side shot shows as a body tilt, a sideways plant foot and the far arm flung wide. A shot down the middle shows as a crouch with both arms spread. I checked frames of the left lean at 4× zoom and it reads clearly; I did not review the right-side or centre lean frames. The rules popup says what the tells mean.
  • Scene: The pitch has chalk lines, a stone wall, a goal with a net, and a flag on the wall. Only the net and the flag move on their own, and both stop under prefers-reduced-motion. The people are drawn 1.2× larger than the goal would strictly allow, so the lean is readable at 360×280.
  • Input: Tap or click the left, middle or right of the canvas (thirds, split at 36% and 64%), or press Left, Right and Up. A tap after the result starts a new round.
  • Wiring: GAMES entry, home <li>, README table row, music-free list and serve.test.mjs are done, and bun scripts/og.mjs has been run. og/goalkeeper.png is new and og/home.png is regenerated. No .mp3 is committed. The page has #mute.
  • Tests: goalkeeper/page.test.mjs plays the page in the playtest harness: a save from reading the tell, a wrong-side dive, standing still, the keyboard, a full ten-save round with the saved best, and a loss line. The shared playtest.test.mjs passes for the new folder too.

Choices:

  • High or low shots change the drawn ball and the keeper's reach but not the rules. A dive to the right side saves either way.
  • Standing still concedes even a shot down the middle. Only an explicit middle tap or Up saves it.
  • No dependencies added.

To try it, open /goalkeeper/. Watch the taker from about 0.5 s into the run-up and tap the side they lean. Dive before they show it to see the switch.

An untracked set of dotfiles (.bashrc, .claude/ and others) was already in the clone; I did not commit them.

🤖 Generated with Claude Code

commented

All four points from the review are addressed and pushed. bun test goalkeeper passes (18 tests); I did not rerun the full suite or serve.test.mjs for this wording change.

  1. Tap zones: I kept the thirds in the code (dive left below 36%, right above 64%, stay up in between). The rules popup, the canvas aria-label and the README row now say "left third, right third, middle third". This replaces the "half" wording the issue first asked for. That means a tap at 45% staying up is now what the text promises. I did not regenerate og/. The share-card description comes from the one-line blurb, which doesn't mention halves.
  2. Dead code: I removed let netBulge = 0;.
  3. Test gap: goalkeeper/page.test.mjs has a new page test. It finds a seed where the early dive switches the taker and taps the middle before the tell window opens. It asserts the status says "you dived early, the taker switched". It then repeats the same dive inside the window on the same seed and asserts no switch is reported.
  4. Direction: The README row now says the concept is the ordinary football penalty, with no particular game as its source. I know of no specific inspiration.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs