How jslegenddev/javascript-metroidvania works
Main Components Organization
a) Game Engine Layer
• Kaboom.js at the foundation level
• It to the core game systems via the kaboomLoader.js
b) Core Game Architecture
Following major systems:
• Scene Management System
• Entity Management System
• State Management System
• UI System
• Asset Management System
Detailed Component Breakdown
Create distinct sections for each major system:
a) Scene Management (maps & scenes folders)
• Relationship between room1.js, room2.js, and roomUtils.js
• To corresponding map files (room1.json, room2.json)
• Scene loading and transition flows
b) Entity System (entities folder)
• Branch out to specific entities:
• player.js
• enemyBoss.js
• enemyDrone.js
• healthCartridge.js
• Inheritance and interaction patterns
c) State Management
• GlobalStateManager.js as a central hub
• State flow to other systems
• Game state persistence patterns
d) UI System
• HealthBar.js and notificationBox.js components
• Their connection to the state management system
• Event handling flow
e) Asset Management
• Assets by type (sounds, sprites, palette)
• Loading patterns and resource management
Use the following visual elements:
• Rectangles: For major systems and components
• Rounded rectangles: For individual entities and UI elements
• Hexagons: For asset containers
• Blue: Core engine components
• Green: Game logic and entities
• Yellow: UI elements
• Purple: Asset management
• Red: State management
Key Relationships to Highlight
• How main.js orchestrates the entire system
• How globalStateManager.js interfaces with all major systems
• Demonstrate the relationship between scenes and their corresponding map files
• How entities interact with the state management system
• UI component updates based on state changes