Description
GameEngine.tsx is approximately 1900+ lines and handles too many concerns in a single file.
Current State
Boss logic has been extracted to systems/bossSystem.ts, but background SVG rendering, spawn logic, and collision handling are still concentrated in the engine component.
Suggested Fix
- Extract background/SVG rendering to a dedicated module (e.g.,
systems/renderSystem.ts)
- Move spawn logic to
systems/spawnSystem.ts
- Consider splitting collision dispatch to
systems/collisionSystem.ts
- Each extraction should be a separate commit within the same PR
- After each extraction, verify that GameEngine imports and calls the extracted module correctly
- Run the game locally if possible to verify no behavioral changes
Verification
Automation Hints
scope: src/components/GameEngine.tsx, src/systems/
do-not-touch: src/scenes/, src/levels/, src/services/, src/server/
approach: extract-modules
risk: high
max-files-changed: 15
blocked-by: none
bail-if: more than 5 circular import errors after extraction, or any runtime error in build
Priority
Medium — doesn't block current work but will slow future level development
Migrated from KNOWN_ISSUES.md
Description
GameEngine.tsxis approximately 1900+ lines and handles too many concerns in a single file.Current State
Boss logic has been extracted to
systems/bossSystem.ts, but background SVG rendering, spawn logic, and collision handling are still concentrated in the engine component.Suggested Fix
systems/renderSystem.ts)systems/spawnSystem.tssystems/collisionSystem.tsVerification
npm run buildpassesnpx tsc --noEmitcleanwc -l src/components/GameEngine.tsxis significantly reducedgrep -r "from.*GameEngine" src/systems/)Automation Hints
scope: src/components/GameEngine.tsx, src/systems/
do-not-touch: src/scenes/, src/levels/, src/services/, src/server/
approach: extract-modules
risk: high
max-files-changed: 15
blocked-by: none
bail-if: more than 5 circular import errors after extraction, or any runtime error in build
Priority
Medium — doesn't block current work but will slow future level development
Migrated from KNOWN_ISSUES.md