Skip to content

Commit d5abb8a

Browse files
author
DavidQ
committed
PR_08_01_GAMES_FLOW_STANDARDIZATION
1 parent d75ade4 commit d5abb8a

8 files changed

Lines changed: 92 additions & 13 deletions

File tree

docs/dev/CODEX_COMMANDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
MODEL: GPT-5.4
22
REASONING: medium
3-
COMMAND: Implement PR_08_04_TOOL_STATE_BINDING
3+
COMMAND: Implement PR_08_01_GAMES_FLOW_STANDARDIZATION

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PR_08_04_TOOL_STATE_BINDING
1+
PR_08_01_GAMES_FLOW_STANDARDIZATION

docs/dev/reports/flow_contract.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
PR: PR_08_01_GAMES_FLOW_STANDARDIZATION
2+
3+
Standard Flow Contract (v1)
4+
- Required fields:
5+
- id
6+
- label
7+
- contractVersion
8+
- nextFlowId
9+
- autoAdvanceSeconds
10+
- statusText
11+
- returnMode
12+
- resetIdleOnReturn
13+
- debugPluginFactory
14+
15+
Asteroids flow descriptors aligned
16+
- attract.js:
17+
- id=attract
18+
- nextFlowId=intro
19+
- returnMode=menu
20+
- intro.js:
21+
- id=intro
22+
- nextFlowId=highscore
23+
- autoAdvanceSeconds=30
24+
- highscore.js:
25+
- id=highscore
26+
- nextFlowId=attract
27+
- autoAdvanceSeconds=12
28+
29+
Backward compatibility
30+
- Existing exported constants in attract.js and intro.js preserved.
31+
- Flow descriptors extended additively (no removals).
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
PR: PR_08_04_TOOL_STATE_BINDING
1+
PR: PR_08_01_GAMES_FLOW_STANDARDIZATION
22

33
Validation Commands
4-
- node --check tools/shared/livePreviewSyncChannel.js
5-
- node --check "tools/Tilemap Studio/main.js"
6-
- node --check "tools/Parallax Scene Studio/main.js"
7-
- node --check samples/phase-12/1208/main.js
8-
- node --check samples/phase-12/1208/ToolFormattedTilesParallaxScene.js
9-
- node tests/runtime/LaunchSmokeAllEntries.test.mjs
4+
- node --check games/Asteroids/flow/attract.js
5+
- node --check games/Asteroids/flow/intro.js
6+
- node --check games/Asteroids/flow/highscore.js
107

11-
Expected Runtime Checks
12-
- tool-live-preview-sync payloads still apply in sample 1208.
13-
- runtime-state-binding payloads are emitted from sample 1208.
14-
- tile/parallax tools accept valid runtime-state-binding payloads only.
8+
Transition Validation
9+
- attract.nextFlowId => intro (exists)
10+
- intro.nextFlowId => highscore (exists)
11+
- highscore.nextFlowId => attract (exists)
1512

1613
Result
1714
- PASS
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PR_08_01_GAMES_FLOW_STANDARDIZATION
2+
3+
## Purpose
4+
Standardize game flow structure across all games.
5+
6+
## Scope
7+
- attract.js
8+
- intro.js
9+
- highscore.js
10+
11+
## Tasks
12+
- define flow contract
13+
- align existing games
14+
- validate transitions
15+
16+
## Output
17+
<project folder>/tmp/PR_08_01_GAMES_FLOW_STANDARDIZATION.zip

games/Asteroids/flow/attract.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ import { createAsteroidsShowcaseDebugPlugin } from "../debug/asteroidsShowcaseDe
22

33
export const ASTEROIDS_NEW_GAME_OVER_RETURN_MODE = "menu";
44
export const ASTEROIDS_NEW_GAME_OVER_RETURN_RESET_IDLE = true;
5+
export const ASTEROIDS_FLOW_CONTRACT_VERSION = "1";
6+
export const ASTEROIDS_ATTRACT_FLOW_NEXT_ID = "intro";
57

68
export const attractFlow = Object.freeze({
79
id: "attract",
810
label: "Attract",
11+
contractVersion: ASTEROIDS_FLOW_CONTRACT_VERSION,
12+
nextFlowId: ASTEROIDS_ATTRACT_FLOW_NEXT_ID,
13+
autoAdvanceSeconds: null,
14+
statusText: "Press 1 for one player or 2 for two players.",
15+
returnMode: ASTEROIDS_NEW_GAME_OVER_RETURN_MODE,
16+
resetIdleOnReturn: ASTEROIDS_NEW_GAME_OVER_RETURN_RESET_IDLE,
917
debugPluginFactory: createAsteroidsShowcaseDebugPlugin
1018
});

games/Asteroids/flow/highscore.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { createAsteroidsShowcaseDebugPlugin } from "../debug/asteroidsShowcaseDebug.js";
2+
3+
export const ASTEROIDS_FLOW_CONTRACT_VERSION = "1";
4+
export const ASTEROIDS_HIGHSCORE_FLOW_NEXT_ID = "attract";
5+
export const ASTEROIDS_HIGHSCORE_AUTO_EXIT_SECONDS = 12;
6+
export const ASTEROIDS_HIGHSCORE_STATUS = "High scores";
7+
8+
export const highscoreFlow = Object.freeze({
9+
id: "highscore",
10+
label: "Highscore",
11+
contractVersion: ASTEROIDS_FLOW_CONTRACT_VERSION,
12+
nextFlowId: ASTEROIDS_HIGHSCORE_FLOW_NEXT_ID,
13+
autoAdvanceSeconds: ASTEROIDS_HIGHSCORE_AUTO_EXIT_SECONDS,
14+
statusText: ASTEROIDS_HIGHSCORE_STATUS,
15+
returnMode: "menu",
16+
resetIdleOnReturn: true,
17+
debugPluginFactory: createAsteroidsShowcaseDebugPlugin
18+
});

games/Asteroids/flow/intro.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ import { createAsteroidsShowcaseDebugPlugin } from "../debug/asteroidsShowcaseDe
22

33
export const ASTEROIDS_NEW_GAME_OVER_AUTO_EXIT_SECONDS = 30;
44
export const ASTEROIDS_NEW_GAME_OVER_RETURN_STATUS = "Press 1 for one player or 2 for two players.";
5+
export const ASTEROIDS_FLOW_CONTRACT_VERSION = "1";
6+
export const ASTEROIDS_INTRO_FLOW_NEXT_ID = "highscore";
57

68
export const introFlow = Object.freeze({
79
id: "intro",
810
label: "Intro",
11+
contractVersion: ASTEROIDS_FLOW_CONTRACT_VERSION,
12+
nextFlowId: ASTEROIDS_INTRO_FLOW_NEXT_ID,
13+
autoAdvanceSeconds: ASTEROIDS_NEW_GAME_OVER_AUTO_EXIT_SECONDS,
14+
statusText: ASTEROIDS_NEW_GAME_OVER_RETURN_STATUS,
15+
returnMode: "menu",
16+
resetIdleOnReturn: true,
917
debugPluginFactory: createAsteroidsShowcaseDebugPlugin
1018
});

0 commit comments

Comments
 (0)