Astro, Breakout, Pinball and Siege still keep their rules in the scene
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 62/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- game-dev, testing-qa
调研方向
Start with the reference pattern in games/pong/rules.ts and its tests, then open games/breakout/scenes/GameScene.ts, the suggested first candidate, and find pure functions for bounce angles, brick hits or level layout parsing. Move one game's functions into games/breakout/rules.ts with no Phaser import, add rules.test.ts, and have the scene call the module. Run npm test; done means the new tests pass and the scene behaves as before.
由索引模型根据 Issue 内容生成。
描述
Summary
Six games keep their rules in Phaser-free modules with unit tests (Stack, Snake, Maze, Runner, Hop and Pong). Astro Blaster, Neon Breakout, Neon Pinball and Star Siege still mix rules with input, audio and drawing in one scene class, so a rules regression in those four has no automated signal.
Where
games/astro/scenes/GameScene.ts(wave sizes, rock splitting, saucer timing and aim)games/breakout/scenes/GameScene.ts(bounce angles, brick hits, power-up rolls, level layout parsing)games/pinball/scenes/GameScene.ts(scoring and ball save, among others); the table data is already ingames/pinball/table.tsgames/siege/scenes/GameScene.ts(formation movement, enemy fire selection, mothership scoring)- The pattern to follow:
games/pong/rules.ts,games/hop/rules.ts,games/runner/rules.ts
Impact
Low. These games work today; the cost is that changes to them can only be checked by playing.
Suggested fix
One game per change, moving code rather than rewriting it, as was done for Pong:
- Pick the functions that take plain numbers and return plain numbers (collision tests, scoring formulas, spawn rules).
- Move them to
games/<slug>/rules.tswith no Phaser import, passing arandomfunction where the rule rolls dice. - Add
rules.test.tsbeside it and have the scene call the module.
Breakout is the best first candidate: its level layout parsing is also the first step of the level editor.
Acceptance criteria
- Each of the four games has a Phaser-free rules module with unit tests
- The scenes call the modules and behavior is unchanged
Getting started
- Relevant files: the four scenes above and the three reference modules
- How to run tests:
npm test - Related docs:
CONTRIBUTING.md("Checks")
Related: #59, #40, #84
Filed by repo-audit/fix-issues at de2b25b. Severity: low. Effort: L. audit-key: tech-debt|games/astro/scenes/GameScene.ts|rules-extraction
- 主要语言
- TypeScript
- 星标
- 3
- 派生
- 3
- 平均合并
- 10 小时 22 分钟
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/GH-Arcade 的其他 Issue
-
good first issue performance severity: low
难度 3/5 1-2 天 新手友好度 72/100
TMHSDigital/GH-Arcade#141 ·
维护者通常 1 天内回复
-
enhancement help wanted severity: low
难度 4/5 3-5 天 新手友好度 55/100
TMHSDigital/GH-Arcade#139 ·
维护者通常 1 天内回复
-
enhancement help wanted severity: medium
难度 4/5 3-5 天 新手友好度 56/100
TMHSDigital/GH-Arcade#127 ·
维护者通常 1 天内回复
-
enhancement help wanted severity: medium
难度 4/5 3-5 天 新手友好度 48/100
TMHSDigital/GH-Arcade#126 · 1 条评论 ·
维护者通常 1 天内回复
-
accessibility enhancement severity: low
难度 4/5 3-5 天 新手友好度 40/100
TMHSDigital/GH-Arcade#114 ·
维护者通常 1 天内回复
查看 TMHSDigital/GH-Arcade 的全部 Issue
相似的 Issue
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
难度 2/5 1-3 小时 新手友好度 76/100
openclaw/openclaw#203385 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nwverse/persona#12800 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)未关闭
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/playwright#44289 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 半天 新手友好度 65/100
维护者通常 1 天内回复