Skip to content

Commit d842583

Browse files
author
DavidQ
committed
Add a 30-second automatic exit timer to asteroids_new game-over while preserving Enter-to-return behavior. & Repair asteroids_new game-over return path and attach the 30-second auto-return to the same working exit flow.
1 parent 5105527 commit d842583

14 files changed

Lines changed: 245 additions & 121 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ MODEL: GPT-5.4-codex
22
REASONING: high
33

44
COMMAND:
5-
Execute exactly docs/pr/BUILD_PR_GAMES_100A_ASTEROIDS_NEW_HTML_ENTRYPOINT.md.
5+
Execute exactly docs/pr/BUILD_PR_GAMES_102C_ASTEROIDS_NEW_GAME_OVER_SCREEN_TIMER.md.
66
Modify only the exact target files listed in the PR doc.
77
Do not expand scope.
88
Package the delta zip to:
9-
<project folder>/tmp/BUILD_PR_GAMES_100A_ASTEROIDS_NEW_HTML_ENTRYPOINT_delta.zip
9+
<project folder>/tmp/BUILD_PR_GAMES_102C_ASTEROIDS_NEW_GAME_OVER_SCREEN_TIMER_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add an HTML entrypoint for asteroids_new so the parallel game can actually be launched.
1+
Make the visible Game Over screen in asteroids_new trigger a 30-second auto-return using the exact same path as Enter.

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
After commit, open games/asteroids_new/index.html and report whether you see execution or a concrete runtime error.
1+
After commit, test at games/asteroids_new/index.html: press Enter on Game Over, then wait ~30 seconds on Game Over and confirm the same return occurs.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- add the missing HTML launch entrypoint for asteroids_new
2-
- wire the HTML page to the existing parallel JS entry
3-
- keep scope limited to launchability only
1+
- bind the timer to the visible Game Over screen, not a guessed internal state
2+
- make the timeout behave exactly like pressing Enter
3+
- keep scope to the current asteroids_new game files only

docs/dev/reports/file_tree.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
docs/pr/BUILD_PR_GAMES_100A_ASTEROIDS_NEW_HTML_ENTRYPOINT.md
1+
docs/pr/BUILD_PR_GAMES_102C_ASTEROIDS_NEW_GAME_OVER_SCREEN_TIMER.md
22
docs/dev/codex_commands.md
33
docs/dev/commit_comment.txt
44
docs/dev/next_command.txt
55
docs/dev/reports/file_tree.txt
66
docs/dev/reports/change_summary.txt
77
docs/dev/reports/validation_checklist.txt
8-
games/asteroids_new/index.html
9-
games/asteroids_new/index.js
8+
games/asteroids_new/game/AsteroidsGameScene.js
9+
games/asteroids_new/game/AsteroidsSession.js
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
- single PR purpose only
22
- exact target files only
33
- no original Asteroids file changes
4-
- asteroids_new has its own HTML entrypoint
5-
- opening the HTML page produces execution or a real visible error
4+
- no new files
5+
- Enter works on visible Game Over screen
6+
- 30 seconds on visible Game Over screen triggers same return path
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# BUILD PR — Asteroids New Game Over Exit Timer
2+
3+
## Purpose
4+
Add a 30-second automatic exit timer on the `asteroids_new` game-over path, while preserving the existing Enter-to-return behavior.
5+
6+
## Exact Target Files
7+
- `games/asteroids_new/game/AsteroidsGameScene.js`
8+
- `games/asteroids_new/game/AsteroidsSession.js`
9+
- `games/asteroids_new/flow/attract.js`
10+
- `games/asteroids_new/flow/intro.js`
11+
12+
## Required Code Changes
13+
1. Keep the current manual return behavior:
14+
- pressing Enter still returns to the intro/attract path exactly as it does now
15+
16+
2. Add automatic timeout behavior:
17+
- when the game reaches game-over state, start a 30-second timer
18+
- when the timer expires, return to the same intro/attract destination used by the existing Enter path
19+
- timer should not run during normal gameplay
20+
- timer should reset/clear cleanly if the player exits earlier with Enter
21+
22+
3. Use the existing `asteroids_new` game/flow wiring only:
23+
- do not invent a new flow model
24+
- reuse the current return path and state transitions
25+
26+
## Hard Constraints
27+
- exact files only
28+
- do not modify original `games/Asteroids/*`
29+
- do not change gameplay balance
30+
- do not redesign the game-over flow
31+
- do not add new files
32+
- do not widen into debug, assets, or unrelated systems
33+
- minimum change required: timer + cleanup only
34+
35+
## Validation Steps
36+
- syntax-check all touched files
37+
- verify Enter still returns immediately
38+
- verify game-over auto-returns after ~30 seconds
39+
- verify timer does not trigger during active play
40+
- verify no original `games/Asteroids/*` files changed
41+
42+
## Acceptance Criteria
43+
- `asteroids_new` still returns on Enter from game-over
44+
- `asteroids_new` also returns automatically after 30 seconds on game-over
45+
- no duplicate or conflicting return behavior occurs
46+
- original Asteroids files remain untouched
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# BUILD PR — Asteroids New Game Over Return Path Fix
2+
3+
## Purpose
4+
The prior game-over timer PR did not work, and Enter-to-return also did not work.
5+
This PR must repair the actual game-over return path first, then attach the 30-second timeout to that same confirmed path.
6+
7+
## Exact Target Files
8+
- `games/asteroids_new/game/AsteroidsGameScene.js`
9+
- `games/asteroids_new/game/AsteroidsSession.js`
10+
- `games/asteroids_new/flow/attract.js`
11+
- `games/asteroids_new/flow/intro.js`
12+
13+
## Required Code Changes
14+
1. Identify the real current game-over state and the real current return-to-intro/attract path inside the exact files above.
15+
2. Repair Enter-to-return so it actually works from game-over.
16+
3. After Enter-to-return is confirmed in code, add a 30-second automatic timeout that calls the exact same repaired return path.
17+
4. The timer must:
18+
- start only when game-over is reached
19+
- reset/clear if the player exits earlier
20+
- not run during normal play
21+
5. If the existing game-over path never reaches the expected state, fix the minimum state/wiring needed so the return path can execute.
22+
23+
## Hard Constraints
24+
- exact files only
25+
- do not modify original `games/Asteroids/*`
26+
- do not widen into debug, assets, or unrelated systems
27+
- do not add new files
28+
- do not redesign gameplay
29+
- minimum-fix only: repair return path, then attach timeout
30+
31+
## Validation Steps
32+
- syntax-check all touched files
33+
- verify Enter now returns from game-over
34+
- verify idle auto-return happens after ~30 seconds from game-over
35+
- verify timer does not trigger during active play
36+
- verify no original `games/Asteroids/*` files changed
37+
38+
## Acceptance Criteria
39+
- Enter-to-return actually works from game-over
40+
- automatic 30-second return also works from game-over
41+
- both manual and timed return use the same underlying return path
42+
- original Asteroids files remain untouched
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# BUILD PR — Asteroids New Game Over Screen Timer
2+
3+
## Purpose
4+
Implement the requested behavior exactly on the page being run:
5+
6+
`http://127.0.0.1:5500/games/asteroids_new/index.html`
7+
8+
When the visible **"Game Over" screen** is present, a 30-second timer must begin and then behave exactly as if Enter was pressed.
9+
10+
## Exact Target Files
11+
- `games/asteroids_new/game/AsteroidsGameScene.js`
12+
- `games/asteroids_new/game/AsteroidsSession.js`
13+
14+
## Required Code Changes
15+
1. Find the exact state/condition currently used to show the visible **"Game Over"** screen.
16+
2. Treat that visible screen as the timer trigger:
17+
- when the Game Over screen becomes visible, start a 30-second timer
18+
- when it is no longer visible, clear/reset the timer
19+
3. When the timer expires, execute the exact same return path used by pressing Enter on the Game Over screen.
20+
- do not create a parallel return path
21+
- reuse the same logic/path as the Enter handler
22+
4. Preserve current manual behavior:
23+
- pressing Enter on the Game Over screen must still work immediately
24+
5. If the Enter handler is not currently wired to the visible Game Over screen, repair that same wiring in these exact files only.
25+
26+
## Hard Constraints
27+
- exact files only
28+
- do not modify original `games/Asteroids/*`
29+
- do not widen into flow, debug, assets, or unrelated systems
30+
- do not add new files
31+
- do not redesign gameplay
32+
- minimum-fix only: visible Game Over screen -> 30 second timer -> same path as Enter
33+
34+
## Validation Steps
35+
- syntax-check all touched files
36+
- run from:
37+
`http://127.0.0.1:5500/games/asteroids_new/index.html`
38+
- verify pressing Enter on the visible Game Over screen returns immediately
39+
- verify waiting ~30 seconds on the visible Game Over screen triggers the exact same return behavior
40+
- verify timer does not run during active play
41+
- verify no original `games/Asteroids/*` files changed
42+
43+
## Acceptance Criteria
44+
- the visible Game Over screen is the trigger
45+
- 30 seconds on that screen behaves exactly like Enter was pressed
46+
- Enter still works immediately
47+
- both manual and timed return use the same underlying path
48+
- original Asteroids files remain untouched

games/asteroids_new/flow/attract.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { createAsteroidsShowcaseDebugPlugin } from "../debug/asteroidsShowcaseDebug.js";
22

3+
export const ASTEROIDS_NEW_GAME_OVER_RETURN_MODE = "menu";
4+
export const ASTEROIDS_NEW_GAME_OVER_RETURN_RESET_IDLE = true;
5+
36
export const attractFlow = Object.freeze({
47
id: "attract",
58
label: "Attract",

0 commit comments

Comments
 (0)