# fogtail/comp315_project architecture

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

- Interactive diagram: https://gitdiagram.com/fogtail/comp315_project
- Repository: https://github.com/fogtail/comp315_project

## Overview

Echoes Of Fate is a story-driven 2D and visual-novel game. Players progress through three chapters, interact with NPCs to obtain items through minigames, face question-based boss battles, and build Chemical X potency that affects the ending; completed runs can be ranked on a leaderboard. The graph combines that documented gameplay with the sampled entry point and state-management layer. Chapter and feature implementations are not sampled, so those workflow links rely on the README rather than inspected call sites.

Main entry points: [`EchosOfTime`](https://github.com/fogtail/comp315_project/tree/main/EchosOfTime) (Three Chapters), [`EchosOfTime/QuestionScene.cpp`](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/QuestionScene.cpp) (Boss Questions), [`EchosOfTime/Main.cpp`](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Main.cpp) (Game Entry), [`EchosOfTime/StateManager.cpp`](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/StateManager.cpp) (State Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_main["Game Entry<br/>[Main.cpp]"]
  node_states["State Manager<br/>[StateManager.cpp]"]
end

subgraph group_story["Story Progression"]
  node_chapters["Three Chapters"]
  node_npcs["NPC Interactions<br/>[NPC.cpp]"]
  node_items["Special Items<br/>[Item.cpp]"]
  node_ending["Game Ending"]
end

subgraph group_gameplay["Gameplay Systems"]
  node_minigames["Minigames<br/>[MiniGameState.cpp]"]
  node_bosses["Boss Questions<br/>[QuestionScene.cpp]"]
  node_questiondata["Question Lists<br/>[QuestionList.cpp]"]
  node_potency["Potency Bar"]
end

subgraph group_presentation["Presentation"]
  node_audio["Audio Manager<br/>[AudioManager.cpp]"]
  node_video["Video Playback<br/>[Video.cpp]"]
end

subgraph group_ranking["Results"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.cpp]"]
  node_leaderboardui["Leaderboard Screen"]
end

node_player(("Player"))

node_player -.->|"starts game"| node_main
node_main -->|"uses"| node_states
node_states -->|"manages states"| node_chapters
node_chapters -.->|"interact with"| node_npcs
node_npcs -.->|"earn through"| node_minigames
node_minigames -.->|"earn items"| node_items
node_chapters -.->|"unlock battles"| node_bosses
node_bosses -.->|"use questions"| node_questiondata
node_bosses -.->|"affect performance"| node_potency
node_potency -.->|"influences ending"| node_ending
node_player -.->|"enter name"| node_leaderboardui
node_leaderboardui -.->|"view ranking"| node_leaderboard

click node_main "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Main.cpp"
click node_states "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/StateManager.cpp"
click node_chapters "https://github.com/fogtail/comp315_project/tree/main/EchosOfTime"
click node_npcs "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/NPC.cpp"
click node_items "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Item.cpp"
click node_minigames "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/MiniGameState.cpp"
click node_bosses "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/QuestionScene.cpp"
click node_questiondata "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/QuestionList.cpp"
click node_potency "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/GameProgressBar.cpp"
click node_ending "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/ChapterThreeState.cpp"
click node_leaderboard "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Leaderboard.cpp"
click node_leaderboardui "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/LeaderboardState.cpp"
click node_audio "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/AudioManager.cpp"
click node_video "https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Video.cpp"

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_main,node_states toneBlue
class node_chapters,node_npcs,node_items,node_ending toneAmber
class node_minigames,node_bosses,node_questiondata,node_potency toneMint
class node_audio,node_video toneRose
class node_leaderboard,node_leaderboardui,node_player toneIndigo
```

## Components

### Game Runtime

- [Game Entry](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Main.cpp): `EchosOfTime/Main.cpp`
- [State Manager](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/StateManager.cpp): `EchosOfTime/StateManager.cpp`

### Story Progression

- [Three Chapters](https://github.com/fogtail/comp315_project/tree/main/EchosOfTime): `EchosOfTime`
- [NPC Interactions](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/NPC.cpp): `EchosOfTime/NPC.cpp`
- [Special Items](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Item.cpp): `EchosOfTime/Item.cpp`
- [Game Ending](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/ChapterThreeState.cpp): `EchosOfTime/ChapterThreeState.cpp`

### Gameplay Systems

- [Minigames](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/MiniGameState.cpp): `EchosOfTime/MiniGameState.cpp`
- [Boss Questions](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/QuestionScene.cpp): `EchosOfTime/QuestionScene.cpp`
- [Question Lists](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/QuestionList.cpp): `EchosOfTime/QuestionList.cpp`
- [Potency Bar](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/GameProgressBar.cpp): `EchosOfTime/GameProgressBar.cpp`

### Presentation

- [Audio Manager](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/AudioManager.cpp): `EchosOfTime/AudioManager.cpp`
- [Video Playback](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Video.cpp): `EchosOfTime/Video.cpp`

### Results

- [Leaderboard](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/Leaderboard.cpp): `EchosOfTime/Leaderboard.cpp`
- [Leaderboard Screen](https://github.com/fogtail/comp315_project/blob/main/EchosOfTime/LeaderboardState.cpp): `EchosOfTime/LeaderboardState.cpp`

### Other components

- **Player**

## Connections

- Player → Game Entry: starts game
- Game Entry → State Manager: uses (evidence: `EchosOfTime/Main.cpp`)
- State Manager → Three Chapters: manages states (evidence: `EchosOfTime/StateManager.h`)
- Three Chapters → NPC Interactions: interact with (evidence: `README.md`)
- NPC Interactions → Minigames: earn through (evidence: `README.md`)
- Minigames → Special Items: earn items (evidence: `README.md`)
- Three Chapters → Boss Questions: unlock battles (evidence: `README.md`)
- Boss Questions → Question Lists: use questions (evidence: `README.md`)
- Boss Questions → Potency Bar: affect performance (evidence: `README.md`)
- Potency Bar → Game Ending: influences ending (evidence: `README.md`)
- Player → Leaderboard Screen: enter name (evidence: `README.md`)
- Leaderboard Screen → Leaderboard: view ranking (evidence: `README.md`)
