Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Add Window Washer: squeegee a grimy window clean before the cradle drops a floor #38
Check · Review · Land · Live done — Landed and live in production.
Window Washer is added and pushed. bun test passes (162 tests) and I checked the page in a stand-in browser run. Chromium wouldn't start in the sandbox, so I ran the page script against a stub canvas and looked at the frames it drew.
shipped production is serving it deploy ab54f53
2 earlier comments · 1 event
Window Washer is added and pushed. bun test passes (162 tests) and I checked the page in a stand-in browser run. Chromium wouldn't start in the sandbox, so I ran the page script against a stub canvas and looked at the frames it drew. I never ran it with real pointer or keyboard input.
What changed
- Scene:
window-washer/index.htmldraws a brick corner with five windows and a cradle hanging on two ropes, on a 360x280 canvas at the fixed 30° camera. Shadows fall screen-right, and a geranium box on each sill sways at 8 fps. The sway stops underprefers-reduced-motion. - Controls: drag across the glass to wipe, or hold space and use the arrow keys (WASD also works).
#muteis there, no.mp3is committed, and the rules popup is three lines. - Rules:
window-washer/glass.jsholds the grime mask, the squeegee footprint, two-pass droppings, the wet streak that dries after 2.5 s, percentage clean and the 12-second floor timer. The page owns only drawing and input. - Tests:
glass.test.mjsshows one stroke across the middle cleans the cells under it and no others, a dropping needs two separate strokes, and a fully wiped window scores 100. - Registration: the game is added to
GAMESinshell.js, to the home list inindex.html, to the README Games table and add-a-game note, and toserve.test.mjs.
Choices
- Each glass cell is one canvas pixel, so a window is 37×26 cells.
- A new stroke starts at each pointer-down or space-down. That is why a dropping needs two separate strokes: back and forth within one stroke counts once.
- A window's score is the whole-number percentage of clean cells, rounded down, so 100 means every cell is clean.
- The HUD total counts finished windows plus the live percentage of the current one; the maximum is 500.
- Upcoming windows are drawn grimy from the same seed they'll use when the cradle reaches them.
Left out
- There is no washer figure on the platform.
- There is no mullion in the glass.
- There is no sound beyond a squeak and a floor chime.
- The repo has no
scripts/ortscsetup, so I ran onlybun test.
Try it: bun serve.mjs, then open /window-washer/.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. The three conflicts are resolved, and the tests pass (173 pass, 0 fail). bun x tsc --noEmit printed nothing, so there were no type errors. I haven't checked the preview or the forge's check result.
The conflicts in README.md, index.html and shell.js were all the same kind: this pull added Window Washer next to where main added Market Scale. I kept both games in each file. In the README paragraph on adding a game, I changed the list of games that play on their own sound effects to end "Lighthouse, Market Scale and Window Washer".
The untracked dotfiles in the clone (.bash_profile, .bashrc, .claude/ and similar) are not part of the commit.
Most of this is solid. The preview answers 200 on /, /window-washer/ and glass.js, and the home list shows the game with the forged credit. The tests at the head pass (29 across glass, serve and shell). I rendered a frame headlessly from the engine and the page script, which drives update/draw with simulated drags: the brick corner, five windows, cradle on ropes, geranium boxes and the screen-right shadow all draw as the issue asks. The rules module is clean and plain-data. This static app has no auth, writes or tty, so those parts of the checklist don't apply.
I found three bugs a player will hit. Please fix all of them in this round:
- Fix first: the hover squeegee doesn't follow the mouse.
pointermovesetsG.hoverand then returns unless dragging, soG.curnever moves. On desktop the squeegee is drawn parked at the centre of the glass (or wherever the last drag ended) while the cursor is somewhere else. UpdateG.cur = cellAt(e)on every move while the round is on, and only wipe when dragging.
- Finished windows stay wet forever.
advanceonly driess.window. When the cradle drops, the old window goes intoG.donewith its wet values frozen. I checked: stroke at 11.5 s, advance 10.5 s more, andmax(wet)on the finished window is still 2. Any streak made in a window's last 2.5 s stays white on that window for the rest of the round. The issue says the streak dries. Either dry the finished windows too, or clearwetwhen scoring. Add a glass test that fails today.
- The status line's messages are never seen.
HINT(set at boot and on restart) andwindow N: P% clean(set on the score event) are overwritten on the next frame by thewindow N of 5 · Xs · P% cleanline, because that runs on every frame with no events. So the per-window score never shows, and the controls hint is dead code. Either hold the score/hint message for a moment, or drop them. While there,if (events.length) renderHud(); else if (R.phase === 'play') renderHud();can be one condition.
Minor: groundColor takes an unused i parameter.
I fixed all three bugs and the minor point, and pushed the branch. The window-washer, serve and shell tests pass (30). I haven't looked at the preview. bun scripts/design-lint.ts isn't in this clone, so I couldn't run it. bun x tsc --noEmit printed only its usage text, which looks like there's no tsconfig, so it checked nothing.
- Hover squeegee (
window-washer/index.html):pointermovenow setsG.curon every move while the round is on, and only wipes when dragging. The drawn squeegee follows the mouse. - Finished windows stay wet (
window-washer/glass.js):advancenow clearsweton the window it scores, so a late streak no longer stays white on a finished window. The new testa window scored with a late streak is left dryinwindow-washer/glass.test.mjsstrokes in the last second, advances past the drop, and checksmax(wet)is 0. It fails without the fix. - Status line: the controls hint (boot and restart) and the
window N: P% cleanscore message now go through a newnote(), which holds them for 2.5 s before the per-framewindow N of 5 · Xs · P% cleanline takes over again. I kept both messages instead of dropping them. The tworenderHudlines are now one condition. - Minor: I removed the unused
iparameter fromgroundColor.
All four asks from my last review (head 3d697f9) are met at bf77209. The window-washer and serve tests pass at this head (26 pass, 0 fail). The preview answers 200 on /, /window-washer/, glass.js and shell.js, and it serves this head's code (wet.fill(0) and noteUntil are both there).
- Hover squeegee: met.
pointermovenow setsG.curon every move while the round is on, and only wipes when dragging. The drawn squeegee follows the cursor. - Finished windows stay wet: met.
advanceclearsweton the window it scores. The new testa window scored with a late streak is left drywould fail without the fix:dryleaves 1.5 on the late streak before scoring, so the finalmax(wet)would not be 0. - Status messages never seen: met.
note()holds the hint and thewindow N: P% cleanmessage for 2.5 s before the per-frame line takes over. At round end the over message still replaces it straight away, which is right. The tworenderHudbranches are now one condition. - Minor: met. The unused
iparameter is gone fromgroundColor.
Nothing new in the changed lines. This is a static app with no auth, writes or tty, so those checklist items don't apply. The game is registered in GAMES, the home list and the README, with the forged credit.
Window Washer is added and pushed.
bun testpasses (162 tests) and I checked the page in a stand-in browser run. Chromium wouldn't start in the sandbox, so I ran the page script against a stub canvas and looked at the frames it drew. I never ran it with real pointer or keyboard input.What changed
window-washer/index.htmldraws a brick corner with five windows and a cradle hanging on two ropes, on a 360x280 canvas at the fixed 30° camera. Shadows fall screen-right, and a geranium box on each sill sways at 8 fps. The sway stops underprefers-reduced-motion.#muteis there, no.mp3is committed, and the rules popup is three lines.window-washer/glass.jsholds the grime mask, the squeegee footprint, two-pass droppings, the wet streak that dries after 2.5 s, percentage clean and the 12-second floor timer. The page owns only drawing and input.glass.test.mjsshows one stroke across the middle cleans the cells under it and no others, a dropping needs two separate strokes, and a fully wiped window scores 100.GAMESinshell.js, to the home list inindex.html, to the README Games table and add-a-game note, and toserve.test.mjs.Choices
Left out
scripts/ortscsetup, so I ran onlybun test.Try it:
bun serve.mjs, then open/window-washer/.🤖 Generated with Claude Code
Closes #30