How samadipour/snack-hole-game works
Snack Hole is a browser game: players steer a growing hole through timed rounds or a relaxed Tour, swallow props to grow and earn cash, then spend or prestige to advance. The runtime centers on the game controller and World simulation, with procedural maps, economy/save state, rendering, audio, and UI supporting that loop. The README also documents trophies, collection, abilities, helper holes, and offline play. Balance simulation is a substantial companion subsystem; its sampled files show simulated rounds and whole-playthrough evaluation. Some UI and runtime connections are based on the source index, not inspected implementation excerpts.
Main entry points: game.ts Game Controller · progress.ts Playthrough Evaluator · round.ts Simulated Rounds · world.ts World Simulation
Components 26
Game Runtime
- Game Controller
src/game.ts - Offline Install
src/pwa.ts
World And Progression
- World Simulation
src/core/world.ts - Timed Rounds
src/core/round.ts - Casual Tour
src/core/tour.ts - Map Selection
src/core/mapgen/index.ts - Map Builder
src/core/mapgen/builder.ts - Map Variants
src/core/mapgen - Economy And Prestige
src/core/economy.ts - Save Data
src/core/save.ts - Trophies
src/core/achievements.ts - Local Persistence
src/persistence.ts
Player Experience
- Input Controls
src/ui/input.ts - 3D Renderer
src/render/scene.ts - Prop Geometry
src/render/props.ts - Round HUD
src/ui/hud.ts - Hub And Shop
src/ui/tabs.ts - Menus And Dialogs
src/ui/dialogs.ts - Sound And Music
src/audio/audio.ts
Balance Simulation
- Simulated Rounds
balance/lib/round.ts - Player Bots
balance/lib/bots.ts - Playthrough Evaluator
balance/lib/progress.ts - Round Model
balance/lib/model.ts - Tuning Parameters
balance/lib/params.ts - Balance Reports
balance/report.ts
Other components
- Player
Connections 30
- Player → Input Controls: steers
- Input Controls → Game Controller: sends controls
src/game.ts - Game Controller → World Simulation: creates and updates
src/game.ts - Game Controller → Map Selection: generates maps
src/game.ts - Map Selection → Map Builder: uses builder
src/core/mapgen/index.ts - Map Selection → Map Variants: dispatches maps
src/core/mapgen/index.ts - Game Controller → Timed Rounds: runs rounds
src/game.ts - Game Controller → Casual Tour: runs Tour
src/game.ts - World Simulation → Economy And Prestige: uses formulas
src/core/world.ts - Timed Rounds → World Simulation: uses simulation
src/core/round.ts - Casual Tour → Timed Rounds: uses round logic
src/core/tour.ts - Game Controller → Economy And Prestige: applies progression
src/game.ts - Game Controller → Save Data: serializes progress
src/game.ts - Game Controller → Local Persistence: loads and saves
src/game.ts - Game Controller → Trophies: checks trophies
src/game.ts - Game Controller → 3D Renderer: sets world
src/game.ts - 3D Renderer → Prop Geometry: uses geometry
src/render/scene.ts - Game Controller → Round HUD: configures HUD
src/game.ts - Game Controller → Hub And Shop: shows hub
src/game.ts - Game Controller → Menus And Dialogs: checks modal state
src/game.ts - Game Controller → Sound And Music: unlocks audio
src/game.ts - Game Controller → Offline Install: initializes PWA
- Simulated Rounds → Player Bots: drives simulated players
balance/lib/round.ts - Simulated Rounds → World Simulation: simulates rounds
balance/lib/round.ts - Playthrough Evaluator → Simulated Rounds: runs direct rounds
balance/lib/progress.ts - Playthrough Evaluator → Round Model: samples predictions
balance/lib/progress.ts - Playthrough Evaluator → Tuning Parameters: applies tuning
balance/lib/progress.ts - Round Model → Tuning Parameters: uses parameter set
balance/lib/model.ts - Balance Reports → Playthrough Evaluator: evaluates playthroughs
balance/report.ts - Balance Reports → Simulated Rounds: uses round results
balance/report.ts