# vlwu/parkour-hero architecture

> Architecture diagram of the GitHub repository vlwu/parkour-hero, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vlwu/parkour-hero
- Repository: https://github.com/vlwu/parkour-hero

## Overview

Parkour Hero is a browser-based 2D platform game, launched from its browser entry point: assets and saved settings/state initialize an Engine, which loads levels, runs gameplay systems, and presents results through the renderer and UI. Players progress through movement, hazards, collectibles and completion, with unlocks and settings persisted. A separate level-editor workflow builds and previews custom levels. README capabilities guide the subsystem coverage; only sampled excerpts support specific call edges, so other relationships are omitted rather than inferred.

Main entry points: [`src/core/engine.js`](https://github.com/vlwu/parkour-hero/blob/main/src/core/engine.js) (Engine), [`src/systems/gameplay-system.js`](https://github.com/vlwu/parkour-hero/blob/main/src/systems/gameplay-system.js) (Gameplay systems), [`main.js`](https://github.com/vlwu/parkour-hero/blob/main/main.js) (Game entry), [`src/editor/ui/UIManager.js`](https://github.com/vlwu/parkour-hero/blob/main/src/editor/ui/UIManager.js) (Editor interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_entry["Game entry<br/>[main.js]"]
  node_engine["Engine<br/>[engine.js]"]
  node_ecs["Entity manager<br/>[entity-manager.js]"]
  node_gameplay["Gameplay systems<br/>[gameplay-system.js]"]
  node_movement["Movement and states<br/>[movement-system.js]"]
  node_collision["Collision and combat"]
  node_enemies["Enemy behavior"]
  node_traps["Traps and hazards<br/>[index.js]"]
  node_renderer["Rendering<br/>[renderer.js]"]
  node_assets["Assets and sound<br/>[asset-manager.js]"]
  node_input["Input system<br/>[input-system.js]"]
  node_flow["Game flow"]
end

subgraph group_content["Levels and actors"]
  node_levelmgr["Level manager<br/>[level-manager.js]"]
  node_level["Level data<br/>[level.js]"]
  node_entities["Entity factories<br/>[entity-factory.js]"]
end

subgraph group_progress["Progress and interface"]
  node_state["Game state<br/>[game-state.js]"]
  node_storage[("Save and settings<br/>[storage-manager.js]")]
  node_ui["Game interface<br/>[ui-main.js]"]
  node_hud["HUD<br/>[hud.js]"]
end

subgraph group_editor["Level editor"]
  node_editorentry["Editor entry<br/>[editor.main.js]"]
  node_editui["Editor interface<br/>[UIManager.js]"]
  node_tools["Editing tools<br/>[ToolManager.js]"]
  node_objects["Object manager<br/>[ObjectManager.js]"]
  node_grid["Tile grid<br/>[Grid.js]"]
  node_history["Edit history<br/>[HistoryManager.js]"]
  node_export["Level import export<br/>[LevelExporter.js]"]
  node_preview["Level preview<br/>[PreviewManager.js]"]
end

node_player(("Player"))
node_browserstore[("Browser storage")]

node_player -->|"opens game"| node_entry
node_entry -->|"loads state"| node_storage
node_storage -->|"reads writes"| node_browserstore
node_entry -->|"starts"| node_engine
node_entry -->|"loads assets"| node_assets
node_engine -->|"requests levels"| node_levelmgr
node_levelmgr -->|"loads data"| node_level
node_engine -->|"constructs level"| node_level
node_engine -->|"creates player"| node_entities
node_entities -->|"adds components"| node_ecs
node_engine -->|"manages entities"| node_ecs
node_engine -->|"updates input"| node_input
node_engine -->|"runs systems"| node_gameplay
node_gameplay -->|"updates motion"| node_movement
node_gameplay -->|"checks collisions"| node_collision
node_gameplay -->|"updates enemies"| node_enemies
node_gameplay -->|"updates hazards"| node_traps
node_engine -->|"renders frame"| node_renderer
node_renderer -->|"uses assets"| node_assets
node_engine -->|"updates progress"| node_state
node_engine -->|"updates HUD"| node_hud
node_ui -->|"game controls"| node_engine
node_ui -->|"saves preferences"| node_storage
node_editorentry -->|"initializes editor"| node_editui
node_editui -->|"routes actions"| node_tools
node_tools -->|"edits tiles"| node_grid
node_tools -->|"edits objects"| node_objects
node_editui -->|"records edits"| node_history
node_editui -->|"imports exports"| node_export
node_preview -->|"runs preview"| node_engine
node_preview -->|"builds level data"| node_export

click node_entry "https://github.com/vlwu/parkour-hero/blob/main/main.js"
click node_engine "https://github.com/vlwu/parkour-hero/blob/main/src/core/engine.js"
click node_ecs "https://github.com/vlwu/parkour-hero/blob/main/src/core/entity-manager.js"
click node_gameplay "https://github.com/vlwu/parkour-hero/blob/main/src/systems/gameplay-system.js"
click node_movement "https://github.com/vlwu/parkour-hero/blob/main/src/systems/movement-system.js"
click node_collision "https://github.com/vlwu/parkour-hero/blob/main/src/systems/collision-system.js"
click node_enemies "https://github.com/vlwu/parkour-hero/blob/main/src/ai-behaviors/ai-behavior-factory.js"
click node_traps "https://github.com/vlwu/parkour-hero/blob/main/src/traps/index.js"
click node_renderer "https://github.com/vlwu/parkour-hero/blob/main/src/systems/renderer.js"
click node_assets "https://github.com/vlwu/parkour-hero/blob/main/src/managers/asset-manager.js"
click node_levelmgr "https://github.com/vlwu/parkour-hero/blob/main/src/managers/level-manager.js"
click node_level "https://github.com/vlwu/parkour-hero/blob/main/src/entities/level.js"
click node_entities "https://github.com/vlwu/parkour-hero/blob/main/src/entities/entity-factory.js"
click node_input "https://github.com/vlwu/parkour-hero/blob/main/src/systems/input-system.js"
click node_flow "https://github.com/vlwu/parkour-hero/blob/main/src/systems/game-flow-system.js"
click node_state "https://github.com/vlwu/parkour-hero/blob/main/src/managers/game-state.js"
click node_storage "https://github.com/vlwu/parkour-hero/blob/main/src/managers/storage-manager.js"
click node_ui "https://github.com/vlwu/parkour-hero/blob/main/src/ui/ui-main.js"
click node_hud "https://github.com/vlwu/parkour-hero/blob/main/src/ui/hud.js"
click node_editorentry "https://github.com/vlwu/parkour-hero/blob/main/src/editor/editor.main.js"
click node_editui "https://github.com/vlwu/parkour-hero/blob/main/src/editor/ui/UIManager.js"
click node_tools "https://github.com/vlwu/parkour-hero/blob/main/src/editor/tools/ToolManager.js"
click node_objects "https://github.com/vlwu/parkour-hero/blob/main/src/editor/core/ObjectManager.js"
click node_grid "https://github.com/vlwu/parkour-hero/blob/main/src/editor/grid/Grid.js"
click node_history "https://github.com/vlwu/parkour-hero/blob/main/src/editor/core/HistoryManager.js"
click node_export "https://github.com/vlwu/parkour-hero/blob/main/src/editor/io/LevelExporter.js"
click node_preview "https://github.com/vlwu/parkour-hero/blob/main/src/editor/core/PreviewManager.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_engine,node_ecs,node_gameplay,node_movement,node_collision,node_enemies,node_traps,node_renderer,node_assets,node_input,node_flow toneBlue
class node_levelmgr,node_level,node_entities,node_browserstore toneAmber
class node_state,node_storage,node_ui,node_hud toneMint
class node_editorentry,node_editui,node_tools,node_objects,node_grid,node_history,node_export,node_preview toneRose
class node_player toneIndigo
```

## Components

### Game runtime

- [Game entry](https://github.com/vlwu/parkour-hero/blob/main/main.js): `main.js`
- [Engine](https://github.com/vlwu/parkour-hero/blob/main/src/core/engine.js): `src/core/engine.js`
- [Entity manager](https://github.com/vlwu/parkour-hero/blob/main/src/core/entity-manager.js): `src/core/entity-manager.js`
- [Gameplay systems](https://github.com/vlwu/parkour-hero/blob/main/src/systems/gameplay-system.js): `src/systems/gameplay-system.js`
- [Movement and states](https://github.com/vlwu/parkour-hero/blob/main/src/systems/movement-system.js): `src/systems/movement-system.js`
- [Collision and combat](https://github.com/vlwu/parkour-hero/blob/main/src/systems/collision-system.js): `src/systems/collision-system.js`
- [Enemy behavior](https://github.com/vlwu/parkour-hero/blob/main/src/ai-behaviors/ai-behavior-factory.js): `src/ai-behaviors/ai-behavior-factory.js`
- [Traps and hazards](https://github.com/vlwu/parkour-hero/blob/main/src/traps/index.js): `src/traps/index.js`
- [Rendering](https://github.com/vlwu/parkour-hero/blob/main/src/systems/renderer.js): `src/systems/renderer.js`
- [Assets and sound](https://github.com/vlwu/parkour-hero/blob/main/src/managers/asset-manager.js): `src/managers/asset-manager.js`
- [Input system](https://github.com/vlwu/parkour-hero/blob/main/src/systems/input-system.js): `src/systems/input-system.js`
- [Game flow](https://github.com/vlwu/parkour-hero/blob/main/src/systems/game-flow-system.js): `src/systems/game-flow-system.js`

### Levels and actors

- [Level manager](https://github.com/vlwu/parkour-hero/blob/main/src/managers/level-manager.js): `src/managers/level-manager.js`
- [Level data](https://github.com/vlwu/parkour-hero/blob/main/src/entities/level.js): `src/entities/level.js`
- [Entity factories](https://github.com/vlwu/parkour-hero/blob/main/src/entities/entity-factory.js): `src/entities/entity-factory.js`

### Progress and interface

- [Game state](https://github.com/vlwu/parkour-hero/blob/main/src/managers/game-state.js): `src/managers/game-state.js`
- [Save and settings](https://github.com/vlwu/parkour-hero/blob/main/src/managers/storage-manager.js): `src/managers/storage-manager.js`
- [Game interface](https://github.com/vlwu/parkour-hero/blob/main/src/ui/ui-main.js): `src/ui/ui-main.js`
- [HUD](https://github.com/vlwu/parkour-hero/blob/main/src/ui/hud.js): `src/ui/hud.js`

### Level editor

- [Editor entry](https://github.com/vlwu/parkour-hero/blob/main/src/editor/editor.main.js): `src/editor/editor.main.js`
- [Editor interface](https://github.com/vlwu/parkour-hero/blob/main/src/editor/ui/UIManager.js): `src/editor/ui/UIManager.js`
- [Editing tools](https://github.com/vlwu/parkour-hero/blob/main/src/editor/tools/ToolManager.js): `src/editor/tools/ToolManager.js`
- [Object manager](https://github.com/vlwu/parkour-hero/blob/main/src/editor/core/ObjectManager.js): `src/editor/core/ObjectManager.js`
- [Tile grid](https://github.com/vlwu/parkour-hero/blob/main/src/editor/grid/Grid.js): `src/editor/grid/Grid.js`
- [Edit history](https://github.com/vlwu/parkour-hero/blob/main/src/editor/core/HistoryManager.js): `src/editor/core/HistoryManager.js`
- [Level import export](https://github.com/vlwu/parkour-hero/blob/main/src/editor/io/LevelExporter.js): `src/editor/io/LevelExporter.js`
- [Level preview](https://github.com/vlwu/parkour-hero/blob/main/src/editor/core/PreviewManager.js): `src/editor/core/PreviewManager.js`

### Other components

- **Player**
- **Browser storage**

## Connections

- Player → Game entry: opens game
- Game entry → Save and settings: loads state
- Save and settings → Browser storage: reads writes
- Game entry → Engine: starts
- Game entry → Assets and sound: loads assets
- Engine → Level manager: requests levels
- Level manager → Level data: loads data
- Engine → Level data: constructs level
- Engine → Entity factories: creates player
- Entity factories → Entity manager: adds components
- Engine → Entity manager: manages entities
- Engine → Input system: updates input
- Engine → Gameplay systems: runs systems
- Gameplay systems → Movement and states: updates motion
- Gameplay systems → Collision and combat: checks collisions
- Gameplay systems → Enemy behavior: updates enemies
- Gameplay systems → Traps and hazards: updates hazards
- Engine → Rendering: renders frame
- Rendering → Assets and sound: uses assets
- Engine → Game state: updates progress
- Engine → HUD: updates HUD
- Game interface → Engine: game controls
- Game interface → Save and settings: saves preferences
- Editor entry → Editor interface: initializes editor
- Editor interface → Editing tools: routes actions
- Editing tools → Tile grid: edits tiles
- Editing tools → Object manager: edits objects
- Editor interface → Edit history: records edits
- Editor interface → Level import export: imports exports
- Level preview → Engine: runs preview
- Level preview → Level import export: builds level data
