# alonsopuente1/thecaster architecture

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

- Interactive diagram: https://gitdiagram.com/alonsopuente1/thecaster
- Repository: https://github.com/alonsopuente1/thecaster

## Overview

TheCaster is a CastEngine game with a title menu, map selection, and an ongoing first-person shooter gameplay loop; the README notes that there is no victory condition yet. The graph preserves the player, weapons, enemies, HUD, pickups, and AI/navigation capabilities represented by the source index. Several gameplay links are supported only by indexed references rather than inspected implementation, so those links use the referencing file as evidence; map-file format and runtime details remain unspecified.

Main entry points: [`src/gamescene.cpp`](https://github.com/alonsopuente1/thecaster/blob/main/src/gamescene.cpp) (Game Scene), [`src/hud.cpp`](https://github.com/alonsopuente1/thecaster/blob/main/src/hud.cpp) (HUD), [`src/player.cpp`](https://github.com/alonsopuente1/thecaster/blob/main/src/player.cpp) (Player), [`src/enemy.cpp`](https://github.com/alonsopuente1/thecaster/blob/main/src/enemy.cpp) (Enemy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Scene Navigation"]
  node_menu["Main Menu<br/>[mainmenuscene.cpp]"]
  node_map_select["Map Selection<br/>[mapselectscene.cpp]"]
end

subgraph group_gameplay["Gameplay World"]
  node_player["Player<br/>[player.cpp]"]
  node_game_scene["Game Scene<br/>[gamescene.cpp]"]
  node_enemy["Enemy<br/>[enemy.cpp]"]
  node_ammo_pickup["Ammo Pickup<br/>[ammopickup.cpp]"]
end

subgraph group_combat["Combat Systems"]
  node_gun["Gun<br/>[gun.cpp]"]
  node_weapon_animator["Weapon Animator<br/>[weaponanimator.cpp]"]
end

subgraph group_support["HUD and AI"]
  node_hud["HUD<br/>[hud.cpp]"]
  node_ai["Enemy AI<br/>[ai.hpp]"]
  node_astar["A* Navigation<br/>[astar.hpp]"]
end

node_user(("Player"))

node_user -->|"starts game"| node_menu
node_menu -->|"opens selection"| node_map_select
node_map_select -->|"starts gameplay"| node_game_scene
node_game_scene -->|"manages player"| node_player
node_game_scene -->|"owns HUD"| node_hud
node_game_scene -->|"spawns enemy"| node_enemy
node_game_scene -->|"spawns pickup"| node_ammo_pickup
node_player -->|"uses weapon"| node_gun
node_gun -->|"animates weapon"| node_weapon_animator
node_enemy -->|"uses AI"| node_ai
node_ai -->|"uses pathfinding"| node_astar
node_hud -->|"reads status"| node_player
node_hud -->|"reads weapon"| node_gun
node_hud -->|"reads enemies"| node_enemy

click node_player "https://github.com/alonsopuente1/thecaster/blob/main/src/player.cpp"
click node_menu "https://github.com/alonsopuente1/thecaster/blob/main/src/mainmenuscene.cpp"
click node_map_select "https://github.com/alonsopuente1/thecaster/blob/main/src/mapselectscene.cpp"
click node_game_scene "https://github.com/alonsopuente1/thecaster/blob/main/src/gamescene.cpp"
click node_enemy "https://github.com/alonsopuente1/thecaster/blob/main/src/enemy.cpp"
click node_ammo_pickup "https://github.com/alonsopuente1/thecaster/blob/main/src/ammopickup.cpp"
click node_gun "https://github.com/alonsopuente1/thecaster/blob/main/src/gun.cpp"
click node_weapon_animator "https://github.com/alonsopuente1/thecaster/blob/main/src/weaponanimator.cpp"
click node_hud "https://github.com/alonsopuente1/thecaster/blob/main/src/hud.cpp"
click node_ai "https://github.com/alonsopuente1/thecaster/blob/main/include/ai.hpp"
click node_astar "https://github.com/alonsopuente1/thecaster/blob/main/include/astar.hpp"

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_menu,node_map_select toneBlue
class node_player,node_game_scene,node_enemy,node_ammo_pickup toneAmber
class node_gun,node_weapon_animator toneMint
class node_hud,node_ai,node_astar toneRose
class node_user toneIndigo
```

## Components

### Scene Navigation

- [Main Menu](https://github.com/alonsopuente1/thecaster/blob/main/src/mainmenuscene.cpp): `src/mainmenuscene.cpp`
- [Map Selection](https://github.com/alonsopuente1/thecaster/blob/main/src/mapselectscene.cpp): `src/mapselectscene.cpp`

### Gameplay World

- [Player](https://github.com/alonsopuente1/thecaster/blob/main/src/player.cpp): `src/player.cpp`
- [Game Scene](https://github.com/alonsopuente1/thecaster/blob/main/src/gamescene.cpp): `src/gamescene.cpp`
- [Enemy](https://github.com/alonsopuente1/thecaster/blob/main/src/enemy.cpp): `src/enemy.cpp`
- [Ammo Pickup](https://github.com/alonsopuente1/thecaster/blob/main/src/ammopickup.cpp): `src/ammopickup.cpp`

### Combat Systems

- [Gun](https://github.com/alonsopuente1/thecaster/blob/main/src/gun.cpp): `src/gun.cpp`
- [Weapon Animator](https://github.com/alonsopuente1/thecaster/blob/main/src/weaponanimator.cpp): `src/weaponanimator.cpp`

### HUD and AI

- [HUD](https://github.com/alonsopuente1/thecaster/blob/main/src/hud.cpp): `src/hud.cpp`
- [Enemy AI](https://github.com/alonsopuente1/thecaster/blob/main/include/ai.hpp): `include/ai.hpp`
- [A* Navigation](https://github.com/alonsopuente1/thecaster/blob/main/include/astar.hpp): `include/astar.hpp`

### Other components

- **Player**

## Connections

- Player → Main Menu: starts game
- Main Menu → Map Selection: opens selection (evidence: `src/mainmenuscene.cpp`)
- Map Selection → Game Scene: starts gameplay (evidence: `src/mapselectscene.cpp`)
- Game Scene → Player: manages player
- Game Scene → HUD: owns HUD
- Game Scene → Enemy: spawns enemy (evidence: `src/gamescene.cpp`)
- Game Scene → Ammo Pickup: spawns pickup (evidence: `src/gamescene.cpp`)
- Player → Gun: uses weapon
- Gun → Weapon Animator: animates weapon
- Enemy → Enemy AI: uses AI
- Enemy AI → A* Navigation: uses pathfinding (evidence: `include/ai.hpp`)
- HUD → Player: reads status (evidence: `src/hud.cpp`)
- HUD → Gun: reads weapon (evidence: `src/hud.cpp`)
- HUD → Enemy: reads enemies (evidence: `src/hud.cpp`)
