Extract a shared endRun helper for the game-over handoff
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 57/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- game-dev
调研方向
Start with shared/scenes.ts and shared/pause.ts, then inspect the listed GameScene.ts examples and locate the other game-over call sites. Trace how each game guards the end of a run and builds restart data; migrate the ten games to the typed helper and run npm run typecheck and npm run build. Done when all ten use the helper and both checks pass.
由索引模型根据 Issue 内容生成。
描述
Summary
Every game repeats the same end-of-run code: set a private "over" flag, wait, then scene.start('GameOver', { gameId, score, ... }) with an unchecked object literal.
Where
shared/scenes.ts:72-79(GameOverDatais exported but imported by no game)- For example
games/astro/scenes/GameScene.ts:486-490,games/breakout/scenes/GameScene.ts:432-441,games/siege/scenes/GameScene.ts:541-547,games/stack/scenes/GameScene.ts:447-453
Details
- The payload is untyped at all ten call sites, so a misspelled field compiles.
- The "over" flag has five spellings (
over,levelDone,alive,phase === 'over',state === 'over'), and only Siege guards against a double call. - Restart data is stated twice per game, once for the pause menu and once for game over.
- Scene keys are bare strings in the shared modules and every scene constructor.
Suggested fix
- Add
endRun(scene, data: GameOverData, delayMs)toshared/scenes.tswith a once-only guard, and export scene-key constants. - Migrate one game per commit.
- Let
PauseControllerandendRunread restart data from one place.
Acceptance criteria
- All ten games end a run through one typed helper
Getting started
- Relevant files:
shared/scenes.ts,shared/pause.ts,games/*/scenes/GameScene.ts - Run locally:
npm install, thennpm run dev - Checks:
npm run typecheckandnpm run build(there is no test suite yet) - Related docs:
README.md
Filed by repo-audit/full-audit at b001f5d. Severity: low. Effort: M. audit-key: tech-debt|shared/scenes.ts|GameOverData
- 主要语言
- TypeScript
- 星标
- 3
- 派生
- 3
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/GH-Arcade 的其他 Issue
-
enhancement good first issue severity: low
难度 2/5 1-3 小时 新手友好度 82/100
TMHSDigital/GH-Arcade#50 ·
-
enhancement good first issue severity: medium
难度 2/5 1-3 小时 新手友好度 86/100
TMHSDigital/GH-Arcade#47 ·
-
documentation good first issue severity: low
难度 2/5 1-3 小时 新手友好度 78/100
TMHSDigital/GH-Arcade#34 ·
-
documentation good first issue severity: low
难度 2/5 1-3 小时 新手友好度 78/100
TMHSDigital/GH-Arcade#33 ·
-
dependencies good first issue severity: low
难度 2/5 1-3 小时 新手友好度 85/100
TMHSDigital/GH-Arcade#27 ·
查看 TMHSDigital/GH-Arcade 的全部 Issue
相似的 Issue
-
automated-triage type/bug type/ci
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 84/100
asasemahmed/openboard#68 ·
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools reference未关闭documentation
难度 2/5 1-3 小时 新手友好度 78/100