How unodostres-quatro/srasa-quatro works
Project Quatro is a narrative 3D driving and exploration game: the player progresses from home and commute through a portal into voxel-castle exploration and environmental puzzles, with a pocket-scale vehicle mechanic. The app coordinates session and interface state, while a 3D canvas and unified world render gameplay; vehicle physics, collision, and game state are supporting runtime layers. Multiplayer position sync is a separate Supabase Realtime capability. README capabilities inform the feature branches, but unsampled implementations and persistence flows are not assumed.
Main entry points: ProjectQuatroApp.tsx Session Orchestrator · GameCanvas.tsx 3D Game Canvas · useGameRealtime.ts Position Sync · UnifiedWorld.tsx Unified World
Components 22
Game Experience
- Game Route
src/app/page.tsx - Session Orchestrator
src/components/game/ProjectQuatroApp.tsx - 3D Game Canvas
src/components/game/GameCanvas.tsx - Game Overlays
src/components/ui - Character Portraits
src/components/ui/CharacterPortraits.tsx - Localization
src/game/localization/useLocalization.ts
World and Story
- Unified World
src/game/world/UnifiedWorld.tsx - Story Locations
src/game/world - Castle Puzzle
src/components/ui/CastleEscapeRoomModal.tsx
Gameplay Systems
- Quatro Vehicle
src/game/vehicle/QuatroMesh.tsx - Vehicle Physics
src/game/vehicle/vehiclePhysics.ts - Vehicle State
src/game/vehicle/vehicleTypes.ts - Player Collision
src/game/core/playerCollision.ts - Game Session State
src/game/core/gameStore.ts - Audio Engine
src/game/audio/SoundManager.ts - Weapon System
src/game/weapons/WeaponSystem.tsx - Player Characters
src/game/character/HumanPlayer.tsx
Realtime Multiplayer
- Position Sync
src/game/realtime/useGameRealtime.ts
Supabase Client
- Browser Client
src/lib/supabase/client.ts - Database Types
src/lib/supabase/database.types.ts
Other components
- Player
- Other Drivers
Connections 25
- Player → Game Route: opens game
src/app/page.tsx - Game Route → Session Orchestrator: renders
src/app/page.tsx - Session Orchestrator → 3D Game Canvas: coordinates gameplay
src/components/game/ProjectQuatroApp.tsx - Session Orchestrator → Unified World: renders world
src/components/game/ProjectQuatroApp.tsx - Session Orchestrator → Game Overlays: shows overlays
src/components/game/ProjectQuatroApp.tsx - Session Orchestrator → Localization: uses translations
src/components/game/ProjectQuatroApp.tsx - Session Orchestrator → Game Session State: updates session
src/components/game/ProjectQuatroApp.tsx - Session Orchestrator → Vehicle Physics: creates vehicle state
src/components/game/ProjectQuatroApp.tsx - Session Orchestrator → Player Collision: resolves position
src/components/game/ProjectQuatroApp.tsx - Game Overlays → Character Portraits: renders portraits
src/components/ui/CharacterSelectModal.tsx - Localization → Session Orchestrator: provides language
src/components/game/ProjectQuatroApp.tsx - 3D Game Canvas → Player Collision: checks collisions
src/components/game/GameCanvas.tsx - 3D Game Canvas → Vehicle State: reads vehicle state
src/components/game/GameCanvas.tsx - 3D Game Canvas → Position Sync: renders remote drivers
src/components/game/GameCanvas.tsx - Unified World → Story Locations: renders locations
src/game/world/UnifiedWorld.tsx - Unified World → Quatro Vehicle: renders vehicle
src/game/world/UnifiedWorld.tsx - Player → Castle Puzzle: solves environmental puzzle
README.md - Session Orchestrator → Castle Puzzle: shows puzzle
src/components/game/ProjectQuatroApp.tsx - Vehicle Physics → Vehicle State: uses state shape
src/game/vehicle/vehiclePhysics.ts - Position Sync → Browser Client: subscribes and broadcasts
src/game/realtime/useGameRealtime.ts - Position Sync → Vehicle State: syncs vehicle state
src/game/realtime/useGameRealtime.ts - Browser Client → Database Types: types client
src/lib/supabase/client.ts - Position Sync → Other Drivers: exchanges driver presence
src/game/realtime/useGameRealtime.ts - 3D Game Canvas → Weapon System: includes weapons
src/components/game/GameCanvas.tsx - 3D Game Canvas → Player Characters: renders player
src/components/game/GameCanvas.tsx