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
Check · Review · Land · Live done — Landed and 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.
shipped production is serving it deploy ab54f53
1 earlier comment · 1 event
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.jsholds 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:
GAMESentry, home<li>, README table row, music-free list andserve.test.mjsare done, andbun scripts/og.mjshas been run.og/goalkeeper.pngis new andog/home.pngis regenerated. No.mp3is committed. The page has#mute. - Tests:
goalkeeper/page.test.mjsplays 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 sharedplaytest.test.mjspasses 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
Preview works: /, /goalkeeper/, shootout.js and the og card all answer 200, the rules are cleanly separated and well tested. Changes needed, all in one round:
- Fix first: the input description is wrong in three places. goalkeeper/index.html (the Rules popup) and the README row say "tap the left or right half of the canvas", but the code splits thirds at 36% and 64% (pointerdown handler: u < .36 / u > .64). A player tapping at 45% expects a dive and stays up instead. Either make the code a true half split with a middle dead-zone described, or say "left third / middle / right third" in the popup, the canvas aria-label and the README.
- Dead code:
let netBulge = 0;in goalkeeper/index.html is declared and never used. Remove it. - Test gap: the early-dive switch is only covered at rules level. Add a page test that dives before the tell window opens on a seed where the taker switches, and asserts the status shows "you dived early, the taker switched" (the one behaviour the popup promises that no page test would catch breaking).
- Direction: the README row and credits give no reference for the original idea of penalty-saving games beyond the generic crew note; if there is a specific inspiration, name it, otherwise state in the README that the concept is the ordinary football penalty.
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.
- 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. - Dead code: I removed
let netBulge = 0;. - Test gap:
goalkeeper/page.test.mjshas 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. - 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
All four earlier asks are met in the head. (1) Tap zones: the rules popup, aria-label and README now say thirds, matching the 36%/64% split in the code. (2) The dead netBulge is gone. (3) page.test.mjs now covers the early-dive switch and also checks the same dive inside the window does not switch. (4) The README row says the concept is the plain football penalty, with no source game. The preview serves /goalkeeper/ with a 200. The game is wired into the home page, shell.js, the README, serve.test.mjs and og cards. The rules module is plain data with seeded tests. There are no new dependencies. I could not fetch the old head here, so I judged the change as a whole and found no new problems.
Non-blocking: the README row is very long; a shorter row would read better.
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.mjspasses (176 tests). I did not runbun teston the whole repo. The type check printed no errors but the repo has no tsconfig, so I'm not counting it. There is noscripts/gate.ts,scripts/fast.tsorscripts/design-lint.tsin this clone, so none of those ran.goalkeeper/shootout.jsholds 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.mjscovers each rule.prefers-reduced-motion. The people are drawn 1.2× larger than the goal would strictly allow, so the lean is readable at 360×280.GAMESentry, home<li>, README table row, music-free list andserve.test.mjsare done, andbun scripts/og.mjshas been run.og/goalkeeper.pngis new andog/home.pngis regenerated. No.mp3is committed. The page has#mute.goalkeeper/page.test.mjsplays 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 sharedplaytest.test.mjspasses for the new folder too.Choices:
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