feat(classic-games): 新增 Mini Berzerk 小游戏#772
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: ab4f52de1e
ℹ️ 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".
| function updateBerzerk(dt) { | ||
| updatePlayer(dt); | ||
| updateRobots(dt); | ||
| updateShots(dt); |
There was a problem hiding this comment.
Stop updating collisions after game over
When the last life is lost, loseLife() sets gameOver = true but leaves the player and robot positions unchanged; this loop still calls updateRobots(dt) on subsequent animation frames, so if a robot is still within the collision radius, loseLife() keeps running and the Lives HUD drops below 0. Skip robot/shot updates once gameOver is true, or return immediately after the final life is consumed.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260703-2014-berzerk.htmlproject/classic-games/文件名;Berzerk 未与已使用玩法重复。Validation
resetGame、gameLoop、fireShot、updateBerzerk、renderBerzerk。INLINE_JS_PARSE=pass。git diff --check -- project/classic-games/20260703-2014-berzerk.html,无空白错误。Audit
OVERALL_EXIT=0AUDIT_DIR=/tmp/git-commit-audit-20260703-201726-84007Remote
mainSHA:f5ba84844397901a59c6cd2c18f930a09c807230codex/classic-game-20260703-2014-berzerkab4f52de1ebc3a4d8df3805a1e50059b8e01a54b