How yodak025/chomp-crawler works
Chomp Crawler is a browser-based 3D roguelike maze game. The intended play flow loads Pyodide, initializes the engine, generates a maze, and runs ECS simulation; synchronized state then feeds rendering and HUD presentation. The graph includes the documented procedural-generation, ECS, Zustand, and 3D-rendering layers, plus the app and configuration surfaces. Some unsampled wiring is represented only where the README or source index supports it; absent evidence limits several connections.
Main entry points: engine.ts ECS Engine · Game.tsx Game Scene · useGameEngine.ts Engine Hook · GameApp.tsx Game App
Components 26
App and UI
- Landing Page
src/app/page.tsx - Game Route
src/app/game/page.tsx - Game App
src/ui/pages/GameApp.tsx - Game Screens
src/ui/pages - HUD and Menus
src/ui/layout - HUD Widgets
src/ui/common - Config Endpoints
src/app/api/config - Maze Endpoint
src/app/api/maze-gen/[...path]/route.ts
Game Runtime
- Pyodide Loader
src/core/hooks/usePyodide.ts - Engine Hook
src/core/hooks/useGameEngine.ts - ECS Engine
src/core/engine.ts - Game World
src/core/GameWorld.ts - Entity Factory
src/core/entityFactory.ts - Simulation Systems
src/core/systems - World Config Loader
src/core/worldConfigLoader.ts
Maze Generation
- Maze Bridge
src/core/mazeGen.ts - Python Generator
src/maze-gen - MST Connectivity
src/maze-gen/graph_mst.py
3D Presentation
- Game Scene
src/scenes/Game.tsx - Render State Hooks
src/scenes/hooks - Maze Meshes
src/scenes/meshes/maze - Entity Meshes
src/scenes/meshes/entities
State and Types
- Hot State
src/state/useHotState.ts - App State
src/state/useAppStateStore.ts - Game Components
src/types/gameComponents.ts
Other components
- Player
Connections 24
- Player → Landing Page: opens
README.md - Game Route → Game App: renders
src/app/game/page.tsx - Engine Hook → ECS Engine: initializes
src/core/hooks/useGameEngine.ts - Game App → Engine Hook: uses
- ECS Engine → Game World: creates
src/core/engine.ts - ECS Engine → Maze Bridge: generates maze
src/core/engine.ts - ECS Engine → Entity Factory: creates echoes
src/core/engine.ts - ECS Engine → Simulation Systems: runs systems
src/core/engine.ts - ECS Engine → Hot State: syncs snapshots
src/core/engine.ts - ECS Engine → World Config Loader: preloads configs
src/core/engine.ts - Pyodide Loader → Engine Hook: provides runtime
src/core/hooks/useGameEngine.ts - Maze Bridge → Python Generator: executes generation
README.md - Python Generator → MST Connectivity: connects rooms
src/maze-gen/graph_mst.py - Engine Hook → App State: sets transitions
src/core/hooks/useGameEngine.ts - Simulation Systems → Game World: updates entities
src/core/systems/cleanupEventsSystem.ts - Game Scene → Hot State: reads snapshots
- Render State Hooks → Game Components: uses types
src/scenes/hooks/useEchoRenderState.tsx - Game Scene → Render State Hooks: uses
- Game Scene → Maze Meshes: renders maze
- Game Scene → Entity Meshes: renders actors
- HUD and Menus → HUD Widgets: composes
- Game App → Game Screens: selects screens
- Config Endpoints → World Config Loader: serves config
- Maze Endpoint → Python Generator: exposes generation