Add Neon Rush browser racing game - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c120900050
ℹ️ 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.addEventListener("keydown", (event) => { | ||
| keys.add(event.code); | ||
| if (!state.running && (event.code === "Space" || event.code === "Enter")) { | ||
| start(); | ||
| } |
There was a problem hiding this comment.
Reset game state before allowing Space/Enter restart
When the player collides, end() sets state.running = false but does not clear obstacles or reposition the car. The keydown handler lets Space/Enter call start() without a reset(), so after a crash pressing Space/Enter resumes with the old obstacles still overlapping the car, which typically triggers an immediate re‑collision and effectively blocks restart unless the user hits R or the button. This is user-visible because the overlay says “press Start or R”, but Space/Enter is still enabled and behaves incorrectly in that post-crash state.
Useful? React with 👍 / 👎.
Motivation
Description
index.html, реализующий игру "Neon Rush" на Canvas с неоновым оформлением и HUD.←/→,A/D,↑/W,Shift,R), спавн препятствий и ускорителей, проверка столкновений и сохранение рекорда вlocalStorage.Testing
python -m http.serverи выполнен Playwright-скрипт, который загрузилhttp://127.0.0.1:8000/index.htmlи сделал скриншотartifacts/neon-rush.png, проверка прошла успешно.Codex Task