You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Neon Crates: warn when a crate is stuck and offer a hint from the solver #126
Neon Crates gives no warning when a crate is pushed somewhere it can never leave, and has no hint. The solver that could provide both already exists in the repo, though only the tests use it.
Where
games/crates/solver.ts:3-5 ("used by the tests ... Not loaded by the game"), :31-47 (liveCells), :131 (solve)
games/crates/scenes/GameScene.ts:166-220 (step: moves and checks solved, nothing else)
games/crates/levels.ts:175-190 (late levels with par 50 and 68)
Details
liveCells(level) returns the cells from which a crate can still reach a target. solve(level) finds the fewest-moves path. Neither is used by the scene. The only way out of an unwinnable position is repeated UNDO or RESTART, with no sign that the position is already lost.
Proposal
Dead-crate warning (cheap): compute liveCells once per level. When a push lands a crate on a cell that is not live, tint the crate red, play a short buzz and show an "UNDO?" banner. This means moving liveCells into rules.ts or bundling solver.ts.
Hint: give solve an optional start state and a node limit, and add a HINT action. It flashes the next push direction, or shows "NO SOLUTION FROM HERE".
Who benefits
Players on the harder levels, who otherwise push for dozens of moves after a crate is already stuck and then give up. Touch players have only the UNDO and RESTART buttons today.
Open questions
Should hints be free, limited per level, or block the par trophy?
Should a hint search run in a Worker on large levels?
Acceptance criteria
Pushing a crate into a non-target corner shows the warning.
Unit tests cover the live-cell check on several levels.
Part 1 done in 9e5263c: liveCells moved into rules.ts, and the game now tints a crate pink, buzzes and shows 'STUCK UNDO Z' (or 'TAP UNDO' on touch) when a push leaves it where it can never reach a target. Undo and restart clear it. Verified with lint, typecheck, 1042 tests (new liveCells tests for corners, wall runs, and the shipped levels), and in the browser on level 2: pushing the crate into the top wall turned it pink with no console errors. Not done: the HINT action (part 2), which still has the open questions about cost and running the search in a Worker. Leaving this open for that.
Activity
Warn when a Neon Crates crate is pushed where it is stuck (#126)
TMHSDigital commentedon Nov 17, 2026
Part 1 done in 9e5263c: liveCells moved into rules.ts, and the game now tints a crate pink, buzzes and shows 'STUCK UNDO Z' (or 'TAP UNDO' on touch) when a push leaves it where it can never reach a target. Undo and restart clear it. Verified with lint, typecheck, 1042 tests (new liveCells tests for corners, wall runs, and the shipped levels), and in the browser on level 2: pushing the crate into the top wall turned it pink with no console errors. Not done: the HINT action (part 2), which still has the open questions about cost and running the search in a Worker. Leaving this open for that.
Add the Neon Crates stuck-crate warning to the changelog (#126)