How elias-mujally/gridbreak works
GridBreak is a browser-based path-racing strategy game. Players choose a mode, map, layout, and controller, then play a Classic, Rush, or Convergence match locally against AI or other local players, or join an online room. The UI delegates rules and state transitions to shared game modules; online play adds protocol validation, a browser transport client, and a Cloudflare Worker/Durable Object room authority. The graph preserves documented online privacy and rematch capabilities; unsampled modules are included only where the README or source index supports their role.
Main entry points: engine.ts Action engine · App.tsx Local match UI · index.ts Worker admission and transport · room.ts Authoritative room
Components 24
Game experience
- Local match UI
src/ui/App.tsx - Mode and setup picker
src/ui/ModePicker.tsx - Convergence board
src/ui/ConvergenceMatch.tsx - Online match UI
src/ui/OnlineApp.tsx - Online race board
src/ui/OnlineRaceMatch.tsx
Shared game rules
- Modes and map capabilities
src/game/modes.ts - Match state and setup
src/game/state.ts - Action engine
src/game/engine.ts - Movement rules
src/game/movement.ts - Wall legality
src/game/walls.ts - Route search
src/game/pathfinding.ts - Rush actions and rewards
src/game/rush.ts - Rush tiles
src/game/tiles.ts - Player-specific views
src/game/view.ts - AI controller
src/game/ai.ts - Rush AI strategy
src/game/aiRush.ts - Convergence AI
src/game/aiConvergence.ts
Online play
- Browser room client
src/online/client.ts - Online protocol
src/online/protocol.ts - Guest identity
src/online/identity.ts
Room service
- Worker admission and transport
worker/index.ts - Authoritative room
src/online/room.ts - Durable Object storage
Other components
- Player
Connections 32
- Player → Mode and setup picker: chooses match
README.md - Mode and setup picker → Local match UI: starts local match
src/ui/App.tsx - Mode and setup picker → Modes and map capabilities: checks capabilities
src/game/modes.ts - Local match UI → Action engine: applies actions
src/ui/App.tsx - Local match UI → AI controller: requests AI action
src/game/ai.ts - Local match UI → Convergence board: renders Convergence
src/ui/App.tsx - Local match UI → Online match UI: opens online play
src/ui/App.tsx - Convergence board → Action engine: applies local action
src/ui/App.tsx - Match state and setup → Modes and map capabilities: builds configured match
src/game/state.ts - Match state and setup → Rush tiles: generates Rush tiles
src/game/state.ts - Action engine → Movement rules: checks legal moves
src/game/engine.ts - Action engine → Wall legality: checks wall legality
src/game/engine.ts - Action engine → Rush actions and rewards: dispatches Rush actions
src/game/engine.ts - Movement rules → Wall legality: checks steps
src/game/movement.ts - Wall legality → Route search: preserves routes
src/game/walls.ts - Route search → Wall legality: checks traversable edges
src/game/pathfinding.ts - AI controller → Rush AI strategy: delegates Rush strategy
src/game/ai.ts - AI controller → Convergence AI: delegates Convergence strategy
src/game/ai.ts - Rush AI strategy → Player-specific views: evaluates player view
src/game/aiRush.ts - Convergence AI → Route search: scores routes
src/game/aiConvergence.ts - Online match UI → Browser room client: uses room client
src/ui/OnlineApp.tsx - Online match UI → Online race board: renders race match
src/ui/OnlineApp.tsx - Online race board → Player-specific views: derives movement board
src/ui/OnlineRaceMatch.tsx - Browser room client → Online protocol: encodes room messages
src/online/client.ts - Player → Online match UI: joins online room
README.md - Browser room client → Worker admission and transport: connects by WebSocket
README.md - Worker admission and transport → Guest identity: creates guest identity
worker/index.ts - Worker admission and transport → Online protocol: validates messages
worker/index.ts - Worker admission and transport → Authoritative room: dispatches room actions
worker/index.ts - Authoritative room → Action engine: executes authoritative actions
src/online/room.ts - Authoritative room → Player-specific views: projects player views
src/online/room.ts - Authoritative room → Durable Object storage: persists room state
README.md