# sararydavid/sansbossfight architecture

> Architecture diagram of the GitHub repository sararydavid/sansbossfight, 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/sararydavid/sansbossfight
- Repository: https://github.com/sararydavid/sansbossfight

## Overview

This is a Raylib game with a Sans-themed encounter: the player advances through dialogue and menu choices, selects an attack, and then dodges timed hazards. `RunGame` in `Game.cpp` owns the state machine and the encounter’s update and drawing logic; the available excerpts show wave patterns, hazard interactions, damage, and sound playback. The implementation is largely monolithic, so these components describe responsibilities within that runtime rather than separate modules. The README is empty, and the excerpts omit some loading and transition code.

Main entry points: [`Game.cpp`](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp) (Game Loop), [`main.cpp`](https://github.com/sararydavid/sansbossfight/blob/main/main.cpp) (Program Entry), [`GameState.h`](https://github.com/sararydavid/sansbossfight/blob/main/GameState.h) (Game States), [`menu_move.MP3`](https://github.com/sararydavid/sansbossfight/blob/main/menu_move.MP3) (Menu Move Sound)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_encounter["Encounter Flow"]
  node_run_game["Game Loop<br/>[Game.cpp]"]
  node_game_states["Game States<br/>[GameState.h]"]
  node_menu_flow["Dialogue And Menus<br/>[Game.cpp]"]
end

subgraph group_simulation["Gameplay Simulation"]
  node_wave_patterns["Wave Patterns<br/>[Game.cpp]"]
  node_dodge_sim["Dodge Simulation<br/>[Game.cpp]"]
  node_attack_flow["Attack Flow<br/>[Game.cpp]"]
end

subgraph group_presentation["Presentation"]
  node_rendering["Game Rendering<br/>[Game.cpp]"]
  node_sound_playback["Sound Playback<br/>[Game.cpp]"]
  node_menu_move_sound["Menu Move Sound<br/>[menu_move.MP3]"]
end

node_player(("Player"))
node_main["Program Entry<br/>[main.cpp]"]
node_raylib["Raylib"]

node_main -->|"calls"| node_run_game
node_player -->|"provides input"| node_run_game
node_run_game -->|"uses states"| node_game_states
node_run_game -->|"handles choices"| node_menu_flow
node_run_game -->|"handles attacks"| node_attack_flow
node_run_game -->|"loads waves"| node_wave_patterns
node_run_game -->|"updates hazards"| node_dodge_sim
node_run_game -->|"draws frames"| node_rendering
node_run_game -->|"plays sounds"| node_sound_playback
node_sound_playback -->|"plays"| node_menu_move_sound
node_run_game -->|"uses"| node_raylib

click node_main "https://github.com/sararydavid/sansbossfight/blob/main/main.cpp"
click node_run_game "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_game_states "https://github.com/sararydavid/sansbossfight/blob/main/GameState.h"
click node_wave_patterns "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_dodge_sim "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_attack_flow "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_menu_flow "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_rendering "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_sound_playback "https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp"
click node_menu_move_sound "https://github.com/sararydavid/sansbossfight/blob/main/menu_move.MP3"

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_run_game,node_game_states,node_menu_flow toneBlue
class node_wave_patterns,node_dodge_sim,node_attack_flow toneAmber
class node_rendering,node_sound_playback,node_menu_move_sound toneMint
class node_player,node_raylib toneIndigo
class node_main toneTeal
```

## Components

### Encounter Flow

- [Game Loop](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`
- [Game States](https://github.com/sararydavid/sansbossfight/blob/main/GameState.h): `GameState.h`
- [Dialogue And Menus](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`

### Gameplay Simulation

- [Wave Patterns](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`
- [Dodge Simulation](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`
- [Attack Flow](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`

### Presentation

- [Game Rendering](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`
- [Sound Playback](https://github.com/sararydavid/sansbossfight/blob/main/Game.cpp): `Game.cpp`
- [Menu Move Sound](https://github.com/sararydavid/sansbossfight/blob/main/menu_move.MP3): `menu_move.MP3`

### Other components

- **Player**
- [Program Entry](https://github.com/sararydavid/sansbossfight/blob/main/main.cpp): `main.cpp`
- **Raylib**

## Connections

- Program Entry → Game Loop: calls
- Player → Game Loop: provides input
- Game Loop → Game States: uses states
- Game Loop → Dialogue And Menus: handles choices
- Game Loop → Attack Flow: handles attacks
- Game Loop → Wave Patterns: loads waves
- Game Loop → Dodge Simulation: updates hazards
- Game Loop → Game Rendering: draws frames
- Game Loop → Sound Playback: plays sounds
- Sound Playback → Menu Move Sound: plays
- Game Loop → Raylib: uses
