How ybz777/underworld-rise-of-a-kingpin works
Underworld: Rise of a Kingpin is a browser-based crime-management strategy game. The player establishes an organization, manages its people, equipment, territory, businesses, and contracts, then advances through simulation and resolves major operations with tactical crisis choices. App.tsx is the documented UI/state orchestrator; game modules supply initialization, simulation, persistence, combat, crisis logic, audio, and visuals. The README only documents local setup and a Gemini API key; it does not establish an API integration. Some screen and simulation details are unsampled, so links are limited to shown imports and calls.
Main entry points: App.tsx Game interface · initialState.ts Game initialization · simulation.ts Day simulation · crisisEngine.ts Crisis engine
Components 34
Game orchestration
- Game interface
src/App.tsx - Dashboard
src/screens/DashboardScreen.tsx - News feed
src/screens/NewsScreen.tsx - Statistics
src/screens/StatisticsScreen.tsx - Achievements
src/screens/AchievementsScreen.tsx
World and operations
- Contracts catalog
src/data/contracts.ts - Operations board
src/screens/OperationsScreen.tsx - Crisis engine
src/game/crisisEngine.ts - Crisis decisions
src/components/CrisisModal.tsx - Tactical battle
src/components/TacticalBattleModal.tsx - Territories
src/screens/TerritoryScreen.tsx - Factions
src/screens/FactionsScreen.tsx - Event decisions
src/components/EventModal.tsx
Organization management
- Crew management
src/screens/MembersScreen.tsx - Recruit templates
src/data/recruits.ts - Skill trees
src/data/skills.ts - Arsenal
src/screens/ArsenalScreen.tsx - Weapon catalog
src/data/weapons.ts - Market
src/screens/MarketScreen.tsx - Businesses
src/screens/BusinessesScreen.tsx - Vehicle garage
src/screens/GarageScreen.tsx - Starting regions
src/data/regions.ts
Game runtime
- Game initialization
src/game/initialState.ts - Day simulation
src/game/simulation.ts - Combat simulation
src/game/combatSimulation.ts - Save storage
src/game/storage.ts - Game state model
src/game/types.ts - Visual assets
src/game/visuals.ts - Entity imagery
src/components/EntityImage.tsx - Audio engine
src/game/audio.ts - Achievement catalog
src/data/achievements.ts - Business catalog
src/data/businesses.ts - Event catalog
src/data/events.ts
Other components
- Player
Connections 38
- Player → Game interface: plays
- Game interface → Game initialization: initializes
src/App.tsx - Game interface → Save storage: loads and saves
src/App.tsx - Game interface → Day simulation: advances
src/App.tsx - Game interface → Dashboard: renders
src/App.tsx - Game interface → Operations board: renders
src/App.tsx - Game interface → Arsenal: renders
src/App.tsx - Game interface → Market: renders
src/App.tsx - Game interface → Crew management: renders
src/App.tsx - Game interface → Territories: renders
src/App.tsx - Game interface → Businesses: renders
src/App.tsx - Game interface → News feed: renders
src/App.tsx - Game interface → Statistics: renders
src/App.tsx - Game interface → Achievements: renders
src/App.tsx - Game interface → Crisis decisions: renders
src/App.tsx - Game interface → Tactical battle: renders
src/App.tsx - Game interface → Event decisions: renders
src/App.tsx - Operations board → Crisis engine: creates crisis
src/screens/OperationsScreen.tsx - Operations board → Combat simulation: uses combat
src/screens/OperationsScreen.tsx - Crisis decisions → Crisis engine: uses crisis logic
src/components/CrisisModal.tsx - Tactical battle → Combat simulation: simulates combat
src/components/TacticalBattleModal.tsx - Game initialization → Recruit templates: creates crew
src/game/initialState.ts - Game initialization → Contracts catalog: generates contracts
src/game/initialState.ts - Game initialization → Weapon catalog: seeds equipment
src/game/initialState.ts - Game initialization → Starting regions: uses regions
src/game/initialState.ts - Recruit templates → Skill trees: assigns skill trees
src/data/recruits.ts - Day simulation → Event catalog: uses event catalog
src/game/simulation.ts - Day simulation → Contracts catalog: uses contracts
src/game/simulation.ts - Day simulation → Weapon catalog: uses weapon data
src/game/simulation.ts - Entity imagery → Visual assets: gets imagery
src/components/EntityImage.tsx - Weapon catalog → Visual assets: gets weapon art
src/data/weapons.ts - Crisis engine → Visual assets: gets scene art
src/game/crisisEngine.ts - Crisis engine → Game state model: uses state types
src/game/crisisEngine.ts - Combat simulation → Game state model: uses state types
src/game/combatSimulation.ts - Business catalog → Game state model: defines catalog types
src/data/businesses.ts - Achievement catalog → Game state model: uses game types
src/data/achievements.ts - Territories → Combat simulation: uses combat
src/screens/TerritoryScreen.tsx - Vehicle garage → Entity imagery: renders imagery
src/screens/GarageScreen.tsx