# holynova/woool-survivor-game architecture

> Architecture diagram of the GitHub repository holynova/woool-survivor-game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/holynova/woool-survivor-game
- Repository: https://github.com/holynova/woool-survivor-game

## Overview

Woool Survivor is a browser-based 2.5D survivor RPG. The player chooses a class, chapter, and difficulty in the React lobby; the game engine runs combat, waves, progression, and win/loss state; Phaser renders the battle while the UI presents status and level-up choices. The README also documents six themed maps, original animated assets and equipment, and four difficulty curves. The graph follows the excerpts and SOURCE INDEX; unsampled UI and engine details are represented only at subsystem level.

Main entry points: [`src/App.tsx`](https://github.com/holynova/woool-survivor-game/blob/main/src/App.tsx) (Lobby and HUD), [`src/renderer.ts`](https://github.com/holynova/woool-survivor-game/blob/main/src/renderer.ts) (Phaser Renderer), [`src/game.ts`](https://github.com/holynova/woool-survivor-game/blob/main/src/game.ts) (Game Engine), [`src/audio.ts`](https://github.com/holynova/woool-survivor-game/blob/main/src/audio.ts) (Audio Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser Client"]
  node_entry["React Entry<br/>[main.tsx]"]
  node_ui["Lobby and HUD<br/>[App.tsx]"]
end

subgraph group_runtime["Game Runtime"]
  node_engine["Game Engine<br/>[game.ts]"]
  node_renderer["Phaser Renderer<br/>[renderer.ts]"]
  node_audio["Audio Manager<br/>[audio.ts]"]
  node_assetutil["Asset URL Helper<br/>[utils.ts]"]
end

subgraph group_rules["Game Rules"]
  node_chapters["Chapter Rules<br/>[chapters.ts]"]
  node_curves["Difficulty Curves<br/>[curves.ts]"]
  node_skills["Skills and Relics<br/>[skills.ts]"]
  node_types["Game State Types<br/>[types.ts]"]
end

subgraph group_assets["Game Assets"]
  node_maps["Chapter Maps"]
  node_sprites["Character Sprites"]
  node_skillfx["Skill Animations"]
  node_sounds["Sound Effects"]
end

node_player(("Player"))
node_browser(("Browser"))

node_browser -->|"loads app"| node_entry
node_entry -->|"renders"| node_ui
node_player -.->|"chooses and navigates"| node_ui
node_ui -->|"reads and controls"| node_engine
node_ui -->|"boots"| node_renderer
node_ui -->|"presents choices"| node_chapters
node_ui -->|"presents choices"| node_curves
node_ui -->|"presents upgrades"| node_skills
node_ui -->|"uses"| node_audio
node_engine -->|"reads chapter rules"| node_chapters
node_engine -->|"evaluates waves"| node_curves
node_engine -->|"applies abilities"| node_skills
node_engine -->|"plays effects"| node_audio
node_renderer -->|"renders game state"| node_engine
node_renderer -->|"resolves asset URLs"| node_assetutil
node_audio -->|"resolves sound URLs"| node_assetutil
node_renderer -->|"loads maps"| node_maps
node_renderer -.->|"loads sprites"| node_sprites
node_renderer -.->|"loads animations"| node_skillfx
node_audio -->|"loads samples"| node_sounds

click node_entry "https://github.com/holynova/woool-survivor-game/blob/main/src/main.tsx"
click node_ui "https://github.com/holynova/woool-survivor-game/blob/main/src/App.tsx"
click node_engine "https://github.com/holynova/woool-survivor-game/blob/main/src/game.ts"
click node_renderer "https://github.com/holynova/woool-survivor-game/blob/main/src/renderer.ts"
click node_audio "https://github.com/holynova/woool-survivor-game/blob/main/src/audio.ts"
click node_chapters "https://github.com/holynova/woool-survivor-game/blob/main/src/config/chapters.ts"
click node_curves "https://github.com/holynova/woool-survivor-game/blob/main/src/config/curves.ts"
click node_skills "https://github.com/holynova/woool-survivor-game/blob/main/src/config/skills.ts"
click node_types "https://github.com/holynova/woool-survivor-game/blob/main/src/types.ts"
click node_assetutil "https://github.com/holynova/woool-survivor-game/blob/main/src/utils.ts"
click node_maps "https://github.com/holynova/woool-survivor-game/tree/main/public/assets/woool/maps"
click node_sprites "https://github.com/holynova/woool-survivor-game/tree/main/public/assets/woool"
click node_skillfx "https://github.com/holynova/woool-survivor-game/tree/main/public/assets/woool/skills_fx"
click node_sounds "https://github.com/holynova/woool-survivor-game/tree/main/public/assets/sound"

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_ui,node_browser toneBlue
class node_engine,node_renderer,node_audio,node_assetutil toneAmber
class node_chapters,node_curves,node_skills,node_types toneMint
class node_maps,node_sprites,node_skillfx,node_sounds toneRose
class node_player toneIndigo
```

## Components

### Browser Client

- [React Entry](https://github.com/holynova/woool-survivor-game/blob/main/src/main.tsx): `src/main.tsx`
- [Lobby and HUD](https://github.com/holynova/woool-survivor-game/blob/main/src/App.tsx): `src/App.tsx`

### Game Runtime

- [Game Engine](https://github.com/holynova/woool-survivor-game/blob/main/src/game.ts): `src/game.ts`
- [Phaser Renderer](https://github.com/holynova/woool-survivor-game/blob/main/src/renderer.ts): `src/renderer.ts`
- [Audio Manager](https://github.com/holynova/woool-survivor-game/blob/main/src/audio.ts): `src/audio.ts`
- [Asset URL Helper](https://github.com/holynova/woool-survivor-game/blob/main/src/utils.ts): `src/utils.ts`

### Game Rules

- [Chapter Rules](https://github.com/holynova/woool-survivor-game/blob/main/src/config/chapters.ts): `src/config/chapters.ts`
- [Difficulty Curves](https://github.com/holynova/woool-survivor-game/blob/main/src/config/curves.ts): `src/config/curves.ts`
- [Skills and Relics](https://github.com/holynova/woool-survivor-game/blob/main/src/config/skills.ts): `src/config/skills.ts`
- [Game State Types](https://github.com/holynova/woool-survivor-game/blob/main/src/types.ts): `src/types.ts`

### Game Assets

- [Chapter Maps](https://github.com/holynova/woool-survivor-game/tree/main/public/assets/woool/maps): `public/assets/woool/maps`
- [Character Sprites](https://github.com/holynova/woool-survivor-game/tree/main/public/assets/woool): `public/assets/woool`
- [Skill Animations](https://github.com/holynova/woool-survivor-game/tree/main/public/assets/woool/skills_fx): `public/assets/woool/skills_fx`
- [Sound Effects](https://github.com/holynova/woool-survivor-game/tree/main/public/assets/sound): `public/assets/sound`

### Other components

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

## Connections

- Browser → React Entry: loads app (evidence: `src/main.tsx`)
- React Entry → Lobby and HUD: renders (evidence: `src/main.tsx`)
- Player → Lobby and HUD: chooses and navigates
- Lobby and HUD → Game Engine: reads and controls (evidence: `src/App.tsx`)
- Lobby and HUD → Phaser Renderer: boots (evidence: `src/App.tsx`)
- Lobby and HUD → Chapter Rules: presents choices (evidence: `src/App.tsx`)
- Lobby and HUD → Difficulty Curves: presents choices (evidence: `src/App.tsx`)
- Lobby and HUD → Skills and Relics: presents upgrades (evidence: `src/App.tsx`)
- Lobby and HUD → Audio Manager: uses (evidence: `src/App.tsx`)
- Game Engine → Chapter Rules: reads chapter rules (evidence: `src/game.ts`)
- Game Engine → Difficulty Curves: evaluates waves (evidence: `src/game.ts`)
- Game Engine → Skills and Relics: applies abilities (evidence: `src/game.ts`)
- Game Engine → Audio Manager: plays effects (evidence: `src/game.ts`)
- Phaser Renderer → Game Engine: renders game state (evidence: `src/renderer.ts`)
- Phaser Renderer → Asset URL Helper: resolves asset URLs (evidence: `src/renderer.ts`)
- Audio Manager → Asset URL Helper: resolves sound URLs (evidence: `src/audio.ts`)
- Phaser Renderer → Chapter Maps: loads maps (evidence: `src/renderer.ts`)
- Phaser Renderer → Character Sprites: loads sprites
- Phaser Renderer → Skill Animations: loads animations
- Audio Manager → Sound Effects: loads samples (evidence: `src/audio.ts`)
