How pepper-candy/firechicks works
Fire Chicks is an asymmetric multiplayer game: a host runs the shared game on a large screen while phone players join as cooperative Chicks or the Eagle. The workflow moves from room setup and role-based play through tip collection, hunting, disruptive mini-games, a final exam, and transcript-style results. The graph includes the game-state, room-connection, map, scoring, asset-loading, and exam/event layers. Several page and API implementations were not sampled; those links are included only where the README or source index supports them.
Main entry points: useGameLogic.ts Game-state logic · useGameRoom.ts Room connections · App.tsx Route application · Host.tsx Host console
Components 24
Game entry
- Route application
src/App.tsx - Game entry page
src/pages/GameIndex.tsx - Host console
src/pages/Host.tsx - Player client
src/pages/Client.tsx
Rooms and sync
- Room connections
src/hooks/useGameRoom.ts - Room and tip APIs
api - Realtime backend
src/integrations/supabase/client.ts
Game rules and world
- Game-state logic
src/hooks/useGameLogic.ts - Game state types
src/lib/gameTypes.ts - Map and collision rules
src/lib/gameplayMapData.ts - Bot behavior
src/lib/botAI.ts - Grades and scoring
src/lib/gradeSystem.ts - Stage definitions
src/lib/stageInfo.ts - Character viewer
src/components/CharacterViewer.tsx
Exams and events
- Crossy Road event
src/components/events/CrossyRoadClient.tsx - Mock exam client
src/components/events/MockExamClient.tsx - Final exam client
src/components/exam/FinalExamClient.tsx - Exam tips page
src/pages/ExamTips.tsx
Assets and services
- Asset loading
src/context/AssetLoadingContext.tsx - Asset cache
src/lib/assetCache.ts - Asset catalog
src/lib/assets.ts - Asset cache worker
public/asset-cache-sw.js
Other components
- Host
- Phone players
Connections 23
- Host → Host console: runs game
README.md - Phone players → Player client: join by code
README.md - Route application → Game entry page: routes to
src/App.tsx - Route application → Host console: routes to
src/App.tsx - Route application → Player client: routes to
src/App.tsx - Host console → Room connections: uses room
- Player client → Room connections: uses room
src/pages/Client.tsx - Room connections → Room and tip APIs: creates rooms
src/hooks/useGameRoom.ts - Room connections → Realtime backend: syncs state
src/hooks/useGameRoom.ts - Room connections → Game-state logic: exchanges game messages
src/hooks/useGameLogic.ts - Game-state logic → Game state types: serializes state
src/hooks/useGameLogic.ts - Game-state logic → Map and collision rules: resolves movement
src/hooks/useGameLogic.ts - Game-state logic → Grades and scoring: updates grades
src/hooks/useGameLogic.ts - Game-state logic → Bot behavior: uses bot decisions
src/hooks/useGameLogic.ts - Game-state logic → Stage definitions: uses stage data
src/hooks/useGameLogic.ts - Game-state logic → Character viewer: uses character view
src/hooks/useGameLogic.ts - Game-state logic → Crossy Road event: runs mini-games
- Game-state logic → Mock exam client: runs mock exam
- Game-state logic → Final exam client: runs final exam
- Phone players → Exam tips page: read exam tips
README.md - Asset loading → Asset cache: reads and writes
src/context/AssetLoadingContext.tsx - Character viewer → Asset catalog: loads assets
src/components/CharacterViewer.tsx - Asset loading → Asset cache worker: registers worker