Astro, Breakout, Pinball and Siege still keep their rules in the scene
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- game-dev, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 3
- Fork
- 3
- Merge trung bình
- 10 giờ 22 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/GH-Arcade
-
good first issue performance severity: low
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
TMHSDigital/GH-Arcade#141 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted severity: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
TMHSDigital/GH-Arcade#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted severity: medium
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
TMHSDigital/GH-Arcade#127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted severity: medium
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
TMHSDigital/GH-Arcade#126 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a game speed assist settingĐang mởaccessibility enhancement severity: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 40/100
TMHSDigital/GH-Arcade#114 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/GH-Arcade
Issue tương tự
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
blamechris/chroxy#9272 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
no-repo-link tool-submission
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
BraveOPotato/NoSignups#2458 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
drmrd/vernacular#1061 ·
Maintainer thường phản hồi trong vòng 1 ngày