Extract game rules from Phaser scenes into testable modules
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 49/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start with games/stack/logic.ts and its existing patterns, then inspect games/snake/scenes/GameScene.ts and games/maze/scenes/GameScene.ts; the issue recommends working one game per commit. First establish tests for Stack, then identify the rules and state transitions to extract from Snake and Maze without importing Phaser. Done when both games’ rules have unit tests and the trophy thresholds are checked through a shared helper.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Stack keeps its rules in a Phaser-free logic.ts. The other nine games keep state, rules, input, audio, HUD and drawing in one scene class, leaving no seam to test. These are the largest and most-changed files in the repo.
Where
games/maze/scenes/GameScene.ts:231-531(movement, chaser targeting, scoring; 650 lines, 32 methods)games/snake/scenes/GameScene.ts:226-374games/stack/logic.ts:104-206(the pattern to follow)
Details
Trophy score thresholds are also inline magic numbers duplicated against the trophy descriptions (for example games/maze/scenes/GameScene.ts:492 against shared/achievements.ts:66).
Suggested fix
One game per commit, starting with the most-changed:
- Add tests for
games/stack/logic.tsfirst to prove the setup. - Snake: extract step, turn buffer, growth, collision and speed-up into
games/snake/logic.tsas pure functions with tests, then have the scene call them. - Maze: extract chaser targeting, speed rules and catch detection into
games/maze/chase.tswith tests. - Move score thresholds next to the trophy definitions and check them through one shared helper.
Acceptance criteria
- At least Snake and Maze rules are covered by unit tests that do not import Phaser
Getting started
- Relevant files:
games/stack/logic.ts,games/snake/scenes/GameScene.ts,games/maze/scenes/GameScene.ts,games/breakout/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: medium. Effort: L. audit-key: tech-debt|games/maze/scenes/GameScene.ts|GameScene
- Lenguaje dominante
- TypeScript
- Estrellas
- 3
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TMHSDigital/GH-Arcade
-
enhancement good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
TMHSDigital/GH-Arcade#50 ·
-
enhancement good first issue severity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
TMHSDigital/GH-Arcade#47 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/GH-Arcade#34 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/GH-Arcade#33 ·
-
dependencies good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
TMHSDigital/GH-Arcade#27 ·
Todos los issues de TMHSDigital/GH-Arcade
Issues similares
-
automated-triage type/bug type/ci
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
expo/expo#53436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Translate the READMEAbiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
asasemahmed/openboard#68 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools referenceAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100