From ab0c5469f663c299ec9eeb9b2c5d00f3f7a50d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=9D=89=E6=81=AF?= Date: Tue, 4 Aug 2026 20:31:54 +0800 Subject: [PATCH 1/2] fix(templates): stabilize 3D pause lifecycle A real v1.4 game showed repeated Escape events can toggle pause multiple times and end screens can resume gameplay. Ignore keyboard repeats and lock the runtime after completion or failure. --- agent-test/templates/core3d/src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent-test/templates/core3d/src/main.ts b/agent-test/templates/core3d/src/main.ts index 2067f95be..3616f7997 100644 --- a/agent-test/templates/core3d/src/main.ts +++ b/agent-test/templates/core3d/src/main.ts @@ -23,6 +23,7 @@ class GameApp { private readonly gameOverUi = new GameOverUIScene(); private game?: GameScene; private lastFrame = performance.now(); + private ended = false; async boot(): Promise { if (!this.container) throw new Error('Missing #game-container'); @@ -30,7 +31,7 @@ class GameApp { this.title.show(() => this.start()); window.addEventListener('resize', () => this.game?.resize()); window.addEventListener('keydown', (event) => { - if (event.code === 'Escape' && this.game) { + if (event.code === 'Escape' && this.game && !event.repeat && !this.ended) { if (this.game.isPaused()) this.resume('GameScene'); else this.pause('GameScene'); } @@ -45,10 +46,12 @@ class GameApp { { onProgress: (collected, total) => this.ui.update(collected, total), onComplete: () => { + this.ended = true; this.game?.setPaused(true); this.completeUi.show(() => location.reload()); }, onGameOver: () => { + this.ended = true; this.game?.setPaused(true); this.gameOverUi.show(() => location.reload()); }, From 4e4fdf50def3625c7271701e6d14095f68202e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=9D=89=E6=81=AF?= Date: Tue, 4 Aug 2026 20:31:54 +0800 Subject: [PATCH 2/2] fix(templates): serve 3D favicon by path Real-browser review found the core3d shell requests an undeclared favicon. Ship a tiny standalone SVG and reference it relatively, keeping binary data out of editable HTML. --- agent-test/templates/core3d/index.html | 1 + agent-test/templates/core3d/public/favicon.svg | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 agent-test/templates/core3d/public/favicon.svg diff --git a/agent-test/templates/core3d/index.html b/agent-test/templates/core3d/index.html index 432b6fdbf..629d65596 100644 --- a/agent-test/templates/core3d/index.html +++ b/agent-test/templates/core3d/index.html @@ -3,6 +3,7 @@ + OpenGame 3D diff --git a/agent-test/templates/core3d/public/favicon.svg b/agent-test/templates/core3d/public/favicon.svg new file mode 100644 index 000000000..2bbc79a45 --- /dev/null +++ b/agent-test/templates/core3d/public/favicon.svg @@ -0,0 +1,5 @@ + + + + +