feat(classic-games): 新增 Mini Game of Goose 小游戏#1229
Conversation
Made-with: Cursor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0ab68c0be
ℹ️ 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".
| window.setTimeout(() => { | ||
| takeTurn("A"); | ||
| locked = false; | ||
| if (!done) setMessage("Your turn. Roll for an exact finish."); | ||
| render(); | ||
| }, 450); |
There was a problem hiding this comment.
Cancel pending AI turn when starting a new game
If the user clicks New Game during the 450 ms delay after a human roll, the timeout scheduled here is still active and will call takeTurn("A") against the freshly reset positions, so the new game can start with the AI already moved and an old-turn status message. Store the timeout id and clear it in startGame(), or guard the callback with a game/version token.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260718-0224-game-of-goose-lite.htmlValidation
startGame、rollDie、takeTurn、movePlayer、checkWin、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260718-0224-game-of-goose-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260718-022906-64443Commit
60392affaf7a5c67c4adf4da71089c075f16244df0ab68c0be690921d52220f9024ce1727f41e281