Repository navigation
feat(arcade): fill snake stage with more 20px cells - #176
Conversation
Scored runs were locked to 34x18, which letterboxed a small white board inside the cabinet. Keep the original 20px cell size and grow the grid to the measured stage instead.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 019cabd690
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const next = measuredRef.current; | ||
| setBoard(next); | ||
| stateRef.current = initSnake(seed, { | ||
| difficulty: d, | ||
| width: SCORE_BOARD.cols, | ||
| height: SCORE_BOARD.rows, | ||
| width: next.cols, | ||
| height: next.rows, |
There was a problem hiding this comment.
Keep ranked Snake runs on a comparable board
Starting a run with measuredRef.current makes the collision boundary, food distribution, and maximum attainable score depend on the player's viewport/fullscreen state, while ArcadeOverlay still submits every result to the same snake-v2 leaderboard. A player can therefore resize before starting to select anything from the 20×12 minimum to a much larger field, mixing materially different gameplay conditions with existing fixed-34×18 scores; keep ranked dimensions fixed, normalize/version these scores, or make variable-board runs unranked. This also moves a gameplay decision into the renderer despite the repository's pure-rules/thin-renderer invariant.
AGENTS.md reference: AGENTS.md:L71-L74
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Declining this one. The owner asked to fill the cabinet with the same 20px cells (more cells, no scale/zoom). Restoring a fixed 34x18 scored board, versioning scores, or making larger boards unranked would reverse that intent.
The reducer is still dimension-agnostic: initSnake already takes width/height. The renderer only measures how many whole 20px cells fit and passes those numbers in. Scores stay on snake-v2; the leaderboard is already client-trusted at this phase.
Summary
Changes
34x18inSnakeGame.boardForStageso menu, measure, and start all use the same whole-cell fit.Why
The cabinet surface was mostly empty gray around a small white board. The owner asked to enlarge the canvas to that surface without changing pixel scale, gaps, or gameplay rules (speed, food, difficulty, death).
Scores stay on
snake-v2. A larger viewport now means a larger field, which is the original fill-by-grid-size design.Testing
stage.test.ts,SnakeGame.test.tsx,snake.test.ts,ArcadeOverlay.test.tsx: 103 passed)Checklist