Extract a shared endRun helper for the game-over handoff
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 57/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- game-dev
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 3
- Fork
- 3
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/GH-Arcade
-
enhancement good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
TMHSDigital/GH-Arcade#50 ·
-
enhancement good first issue severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
TMHSDigital/GH-Arcade#47 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/GH-Arcade#34 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/GH-Arcade#33 ·
-
dependencies good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
TMHSDigital/GH-Arcade#27 ·
Tutte le issue di TMHSDigital/GH-Arcade
Issue simili
-
automated-triage type/bug type/ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
expo/expo#53436 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Translate the READMEApertadocumentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
asasemahmed/openboard#68 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools referenceApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100