How bridge-mind/leonida works
LEONIDA is a browser-based open-world crime sandbox built around a Three.js/Rapier game loop. The player enters through the game canvas, controls a character or vehicle, and interacts with a generated city, crowds, combat, wanted response, missions, shops, and casino activities; the HUD and map present the resulting state. The graph preserves these major documented gameplay branches and the core runtime layers. Evidence is limited to the README and sampled excerpts/index references; some subsystem internals and their precise call wiring were not sampled.
Main entry points: Game.ts Game loop · index.ts Player controls · GameState.ts Game state · Ped.ts Ped entities
Components 23
Runtime foundation
- Game loop
src/core/Game.ts - Game state
src/core/GameState.ts - Entity contracts
src/core/entities.ts - System contracts
src/core/peers.ts - Event bus
src/core/Events.ts - Rapier physics
src/physics/Physics.ts
City and agents
- City generation
- District data
src/data/districts.ts - Building geometry
src/gfx/BuildingBuilder.ts - Pedestrian simulation
src/systems/peds/index.ts - Ped entities
src/entities/Ped.ts
Gameplay systems
- Player controls
src/systems/player/index.ts - Vehicle simulation
src/systems/vehicles/index.ts - Weapons and damage
src/systems/weapons/index.ts - Police response
src/systems/wanted/index.ts - Shops and money
src/systems/economy/index.ts - Procedural audio
src/systems/audio/api.ts
Missions and casino
- Story missions
src/missions/index.ts - Casino games
src/casino/cards.ts
Player presentation
- HUD and menus
src/systems/ui/index.ts - Full map
src/ui/FullMap.ts - In-game phone
src/ui/phone/Phone.ts
Other components
- Player
Connections 26
- Player → Game loop: starts game
README.md - Game loop → Rapier physics: creates
src/core/Game.ts - Game loop → Game state: owns state
src/core/Game.ts - Game loop → Event bus: creates
src/core/Game.ts - Game loop → Player controls: loads systems
src/core/Game.ts - Player controls → Vehicle simulation: enters vehicles
README.md - City generation → District data: uses districts
src/data/districts.ts - City generation → Building geometry: generates buildings
src/gfx/BuildingBuilder.ts - City generation → Rapier physics: builds collision
- Pedestrian simulation → Ped entities: spawns
src/systems/peds/index.ts - Ped entities → Rapier physics: uses physics
src/entities/Ped.ts - Ped entities → Event bus: emits events
src/entities/Ped.ts - Weapons and damage → Police response: reports crimes
- Police response → Vehicle simulation: dispatches response
- Player controls → Weapons and damage: uses weapons
README.md - Player controls → Shops and money: interacts
README.md - Story missions → Player controls: sets objectives
- Player → Story missions: plays story
README.md - Player → Casino games: plays games
README.md - Casino games → Shops and money: wagers money
- Game loop → Procedural audio: initializes audio
src/core/Game.ts - Game state → HUD and menus: feeds display
src/core/GameState.ts - Full map → Game state: reads state
src/ui/FullMap.ts - In-game phone → Game state: reads game data
src/ui/phone/Phone.ts - Player → HUD and menus: views feedback
README.md - Player → Full map: routes waypoint
src/ui/FullMap.ts