# vanhells/slimebound architecture

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

- Interactive diagram: https://gitdiagram.com/vanhells/slimebound
- Repository: https://github.com/vanhells/slimebound

## Overview

SLIMEBOUND is a Raylib C++ survival platformer. The player launches the game into a menu, selects an unlocked stage, fights waves of slimes and the King Slime boss, then reaches victory, game-over, or credits screens. Game owns the state loop and coordinates combat, stage progression, UI, audio, and display options; Player and Enemy create projectiles, while Projectile handles their movement and collisions. The README documents the broader stage, audio, pause, fullscreen, and ending features. Some Game.cpp excerpts are omitted, so uncertain coordination links are dashed.

Main entry points: [`src/Game.cpp`](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp) (Game controller), [`src/Player.cpp`](https://github.com/vanhells/slimebound/blob/main/src/Player.cpp) (Player combat), [`src/Projectile.h`](https://github.com/vanhells/slimebound/blob/main/src/Projectile.h) (Projectile behavior), [`src/Enemy.cpp`](https://github.com/vanhells/slimebound/blob/main/src/Enemy.cpp) (Enemy combat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Game flow"]
  node_entry["Program entry<br/>[main.cpp]"]
  node_game["Game controller<br/>[Game.cpp]"]
  node_stages["Stage progression<br/>[Game.cpp]"]
  node_arena["Arena and collision<br/>[Game.cpp]"]
end

subgraph group_combat["Combat simulation"]
  node_player["Player combat<br/>[Player.cpp]"]
  node_enemy["Enemy combat<br/>[Enemy.cpp]"]
  node_projectile["Projectile behavior<br/>[Projectile.h]"]
end

subgraph group_presentation["UI and presentation"]
  node_screens["Menus and endings<br/>[Game.cpp]"]
  node_audio_display["Audio and display<br/>[Game.cpp]"]
  node_hud["Gameplay HUD<br/>[Game.cpp]"]
  node_button["Neon buttons<br/>[UI.h]"]
end

subgraph group_foundation["Shared runtime"]
  node_constants["Physics and palette<br/>[Constants.h]"]
  node_assets["Game assets"]
end

node_player_actor(("Player"))
node_raylib["Raylib runtime"]

node_player_actor -->|"launches"| node_entry
node_entry -->|"runs"| node_game
node_game -->|"starts stages"| node_stages
node_game -->|"updates and draws"| node_screens
node_game -.->|"coordinates"| node_player
node_game -.->|"coordinates"| node_enemy
node_game -.->|"coordinates"| node_projectile
node_game -->|"initializes"| node_arena
node_game -.->|"draws"| node_hud
node_game -->|"manages"| node_audio_display
node_screens -.->|"uses"| node_button
node_player -->|"spawns"| node_projectile
node_enemy -->|"spawns"| node_projectile
node_game -->|"resets"| node_player
node_player -->|"takes input"| node_player_actor
node_game -.->|"loads"| node_assets
node_game -.->|"uses graphics and audio"| node_raylib
node_player -->|"uses physics"| node_constants
node_enemy -->|"uses physics"| node_constants
node_projectile -->|"uses bounds"| node_constants
node_button -->|"draws and detects"| node_raylib

click node_entry "https://github.com/vanhells/slimebound/blob/main/src/main.cpp"
click node_game "https://github.com/vanhells/slimebound/blob/main/src/Game.cpp"
click node_stages "https://github.com/vanhells/slimebound/blob/main/src/Game.cpp"
click node_screens "https://github.com/vanhells/slimebound/blob/main/src/Game.cpp"
click node_audio_display "https://github.com/vanhells/slimebound/blob/main/src/Game.cpp"
click node_player "https://github.com/vanhells/slimebound/blob/main/src/Player.cpp"
click node_enemy "https://github.com/vanhells/slimebound/blob/main/src/Enemy.cpp"
click node_projectile "https://github.com/vanhells/slimebound/blob/main/src/Projectile.h"
click node_arena "https://github.com/vanhells/slimebound/blob/main/src/Game.cpp"
click node_hud "https://github.com/vanhells/slimebound/blob/main/src/Game.cpp"
click node_button "https://github.com/vanhells/slimebound/blob/main/src/UI.h"
click node_constants "https://github.com/vanhells/slimebound/blob/main/src/Constants.h"
click node_assets "https://github.com/vanhells/slimebound/tree/main/assets"

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_game,node_stages,node_arena toneBlue
class node_player,node_enemy,node_projectile toneAmber
class node_screens,node_audio_display,node_hud,node_button toneMint
class node_constants,node_assets toneRose
class node_player_actor,node_raylib toneIndigo
```

## Components

### Game flow

- [Program entry](https://github.com/vanhells/slimebound/blob/main/src/main.cpp): `src/main.cpp`
- [Game controller](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp): `src/Game.cpp`
- [Stage progression](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp): `src/Game.cpp`
- [Arena and collision](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp): `src/Game.cpp`

### Combat simulation

- [Player combat](https://github.com/vanhells/slimebound/blob/main/src/Player.cpp): `src/Player.cpp`
- [Enemy combat](https://github.com/vanhells/slimebound/blob/main/src/Enemy.cpp): `src/Enemy.cpp`
- [Projectile behavior](https://github.com/vanhells/slimebound/blob/main/src/Projectile.h): `src/Projectile.h`

### UI and presentation

- [Menus and endings](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp): `src/Game.cpp`
- [Audio and display](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp): `src/Game.cpp`
- [Gameplay HUD](https://github.com/vanhells/slimebound/blob/main/src/Game.cpp): `src/Game.cpp`
- [Neon buttons](https://github.com/vanhells/slimebound/blob/main/src/UI.h): `src/UI.h`

### Shared runtime

- [Physics and palette](https://github.com/vanhells/slimebound/blob/main/src/Constants.h): `src/Constants.h`
- [Game assets](https://github.com/vanhells/slimebound/tree/main/assets): `assets`

### Other components

- **Player**
- **Raylib runtime**

## Connections

- Player → Program entry: launches (evidence: `README.md`)
- Program entry → Game controller: runs (evidence: `src/main.cpp`)
- Game controller → Stage progression: starts stages (evidence: `src/Game.cpp`)
- Game controller → Menus and endings: updates and draws (evidence: `src/Game.cpp`)
- Game controller → Player combat: coordinates
- Game controller → Enemy combat: coordinates
- Game controller → Projectile behavior: coordinates
- Game controller → Arena and collision: initializes (evidence: `src/Game.cpp`)
- Game controller → Gameplay HUD: draws (evidence: `src/Game.cpp`)
- Game controller → Audio and display: manages (evidence: `src/Game.cpp`)
- Menus and endings → Neon buttons: uses
- Player combat → Projectile behavior: spawns (evidence: `src/Player.cpp`)
- Enemy combat → Projectile behavior: spawns (evidence: `src/Enemy.cpp`)
- Game controller → Player combat: resets (evidence: `src/Game.cpp`)
- Player combat → Player: takes input (evidence: `src/Player.cpp`)
- Game controller → Game assets: loads
- Game controller → Raylib runtime: uses graphics and audio
- Player combat → Physics and palette: uses physics (evidence: `src/Player.cpp`)
- Enemy combat → Physics and palette: uses physics (evidence: `src/Enemy.cpp`)
- Projectile behavior → Physics and palette: uses bounds (evidence: `src/Projectile.h`)
- Neon buttons → Raylib runtime: draws and detects (evidence: `src/UI.h`)
