# thetsdz/maze-shooter architecture

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

- Interactive diagram: https://gitdiagram.com/thetsdz/maze-shooter
- Repository: https://github.com/thetsdz/maze-shooter

## Overview

MAZE-SHOOTER is a C/Raylib first-person maze shooter. Its main runtime moves from menu selection into a generated maze and game updates, where player and AI combat, pickups, and projectiles determine progression; rendering and audio present the state, while save/load and LAN multiplayer provide alternate play paths. The README documents the major capabilities. The source index identifies the main loop’s subsystem references and several cross-module references, but unsampled implementations limit certainty about some call details.

Main entry points: [`src/main.c`](https://github.com/thetsdz/maze-shooter/blob/master/src/main.c) (Game loop), [`src/updategame.c`](https://github.com/thetsdz/maze-shooter/blob/master/src/updategame.c) (Game-state update), [`src/dessin.c`](https://github.com/thetsdz/maze-shooter/blob/master/src/dessin.c) (3D and UI rendering), [`src/bot.c`](https://github.com/thetsdz/maze-shooter/blob/master/src/bot.c) (Bot AI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_main["Game loop<br/>[main.c]"]
  node_menu["Main menu<br/>[menu.c]"]
  node_options["Game options<br/>[option.c]"]
  node_gameupdate["Game-state update<br/>[updategame.c]"]
  node_gameover["End screens<br/>[endGame.c]"]
end

subgraph group_combat["World and combat"]
  node_level["Maze generation<br/>[level.c]"]
  node_playercontrol["Player control<br/>[player.c]"]
  node_weapons["Weapon handling<br/>[arme.c]"]
  node_projectiles["Projectile combat<br/>[projectile.c]"]
  node_bots["Bot AI<br/>[bot.c]"]
  node_pathfinding["Pathfinding<br/>[recherche.c]"]
  node_boss["Boss combat<br/>[boss.c]"]
  node_pickups["Chests and pickups<br/>[coffre.c]"]
end

subgraph group_presentation["Presentation"]
  node_render["3D and UI rendering<br/>[dessin.c]"]
  node_textures["Textures and themes<br/>[texture.c]"]
  node_audio["Music and effects<br/>[audio.c]"]
  node_raylib["Raylib rendering API<br/>[raylib.h]"]
  node_raymath["Raylib math API<br/>[raymath.h]"]
  node_rlgl["Raylib GL layer<br/>[rlgl.h]"]
end

subgraph group_services["Persistence and LAN"]
  node_save["Save and load<br/>[sauvegarde.c]"]
  node_checksum["Integrity checksum<br/>[cryptage.c]"]
  node_multiplayer["LAN gameplay<br/>[multijoueur.c]"]
  node_network["Sockets and discovery<br/>[reseau.c]"]
end

node_player(("Player"))
node_localpeer(("LAN peer"))

node_player -->|"starts play"| node_main
node_main -->|"dispatches screens"| node_menu
node_menu -->|"selects screen"| node_main
node_main -->|"opens options"| node_options
node_main -->|"starts maze"| node_level
node_main -->|"updates state"| node_gameupdate
node_gameupdate -->|"updates player"| node_playercontrol
node_gameupdate -->|"updates bots"| node_bots
node_gameupdate -->|"updates boss"| node_boss
node_gameupdate -->|"updates shots"| node_projectiles
node_gameupdate -->|"updates chests"| node_pickups
node_bots -->|"finds route"| node_pathfinding
node_bots -->|"uses weapons"| node_weapons
node_playercontrol -->|"handles weapons"| node_weapons
node_projectiles -->|"checks targets"| node_bots
node_main -->|"shows outcome"| node_gameover
node_main -->|"renders frames"| node_render
node_render -->|"uses assets"| node_textures
node_render -->|"draws through"| node_raylib
node_render -->|"uses math"| node_raymath
node_textures -->|"uses GL layer"| node_rlgl
node_main -->|"manages audio"| node_audio
node_main -->|"saves or loads"| node_save
node_save -->|"checks integrity"| node_checksum
node_main -->|"starts LAN mode"| node_multiplayer
node_multiplayer -->|"exchanges packets"| node_network
node_localpeer -->|"connects or discovers"| node_network
node_multiplayer -->|"draws multiplayer"| node_render

click node_main "https://github.com/thetsdz/maze-shooter/blob/master/src/main.c"
click node_menu "https://github.com/thetsdz/maze-shooter/blob/master/src/menu.c"
click node_options "https://github.com/thetsdz/maze-shooter/blob/master/src/option.c"
click node_level "https://github.com/thetsdz/maze-shooter/blob/master/src/level.c"
click node_playercontrol "https://github.com/thetsdz/maze-shooter/blob/master/src/player.c"
click node_weapons "https://github.com/thetsdz/maze-shooter/blob/master/src/arme.c"
click node_projectiles "https://github.com/thetsdz/maze-shooter/blob/master/src/projectile.c"
click node_bots "https://github.com/thetsdz/maze-shooter/blob/master/src/bot.c"
click node_pathfinding "https://github.com/thetsdz/maze-shooter/blob/master/src/recherche.c"
click node_boss "https://github.com/thetsdz/maze-shooter/blob/master/src/boss.c"
click node_pickups "https://github.com/thetsdz/maze-shooter/blob/master/src/coffre.c"
click node_gameupdate "https://github.com/thetsdz/maze-shooter/blob/master/src/updategame.c"
click node_gameover "https://github.com/thetsdz/maze-shooter/blob/master/src/endGame.c"
click node_render "https://github.com/thetsdz/maze-shooter/blob/master/src/dessin.c"
click node_textures "https://github.com/thetsdz/maze-shooter/blob/master/src/texture.c"
click node_audio "https://github.com/thetsdz/maze-shooter/blob/master/src/audio.c"
click node_save "https://github.com/thetsdz/maze-shooter/blob/master/src/sauvegarde.c"
click node_checksum "https://github.com/thetsdz/maze-shooter/blob/master/src/cryptage.c"
click node_multiplayer "https://github.com/thetsdz/maze-shooter/blob/master/src/multijoueur.c"
click node_network "https://github.com/thetsdz/maze-shooter/blob/master/src/reseau.c"
click node_raylib "https://github.com/thetsdz/maze-shooter/blob/master/lib/Raylib/include/raylib.h"
click node_raymath "https://github.com/thetsdz/maze-shooter/blob/master/lib/Raylib/include/raymath.h"
click node_rlgl "https://github.com/thetsdz/maze-shooter/blob/master/lib/Raylib/include/rlgl.h"

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_menu,node_options,node_gameupdate,node_gameover toneBlue
class node_level,node_playercontrol,node_weapons,node_projectiles,node_bots,node_pathfinding,node_boss,node_pickups toneAmber
class node_render,node_textures,node_audio,node_raylib,node_raymath,node_rlgl toneMint
class node_save,node_checksum,node_multiplayer,node_network toneRose
class node_player,node_localpeer toneIndigo
```

## Components

### Game runtime

- [Game loop](https://github.com/thetsdz/maze-shooter/blob/master/src/main.c): `src/main.c`
- [Main menu](https://github.com/thetsdz/maze-shooter/blob/master/src/menu.c): `src/menu.c`
- [Game options](https://github.com/thetsdz/maze-shooter/blob/master/src/option.c): `src/option.c`
- [Game-state update](https://github.com/thetsdz/maze-shooter/blob/master/src/updategame.c): `src/updategame.c`
- [End screens](https://github.com/thetsdz/maze-shooter/blob/master/src/endGame.c): `src/endGame.c`

### World and combat

- [Maze generation](https://github.com/thetsdz/maze-shooter/blob/master/src/level.c): `src/level.c`
- [Player control](https://github.com/thetsdz/maze-shooter/blob/master/src/player.c): `src/player.c`
- [Weapon handling](https://github.com/thetsdz/maze-shooter/blob/master/src/arme.c): `src/arme.c`
- [Projectile combat](https://github.com/thetsdz/maze-shooter/blob/master/src/projectile.c): `src/projectile.c`
- [Bot AI](https://github.com/thetsdz/maze-shooter/blob/master/src/bot.c): `src/bot.c`
- [Pathfinding](https://github.com/thetsdz/maze-shooter/blob/master/src/recherche.c): `src/recherche.c`
- [Boss combat](https://github.com/thetsdz/maze-shooter/blob/master/src/boss.c): `src/boss.c`
- [Chests and pickups](https://github.com/thetsdz/maze-shooter/blob/master/src/coffre.c): `src/coffre.c`

### Presentation

- [3D and UI rendering](https://github.com/thetsdz/maze-shooter/blob/master/src/dessin.c): `src/dessin.c`
- [Textures and themes](https://github.com/thetsdz/maze-shooter/blob/master/src/texture.c): `src/texture.c`
- [Music and effects](https://github.com/thetsdz/maze-shooter/blob/master/src/audio.c): `src/audio.c`
- [Raylib rendering API](https://github.com/thetsdz/maze-shooter/blob/master/lib/Raylib/include/raylib.h): `lib/Raylib/include/raylib.h`
- [Raylib math API](https://github.com/thetsdz/maze-shooter/blob/master/lib/Raylib/include/raymath.h): `lib/Raylib/include/raymath.h`
- [Raylib GL layer](https://github.com/thetsdz/maze-shooter/blob/master/lib/Raylib/include/rlgl.h): `lib/Raylib/include/rlgl.h`

### Persistence and LAN

- [Save and load](https://github.com/thetsdz/maze-shooter/blob/master/src/sauvegarde.c): `src/sauvegarde.c`
- [Integrity checksum](https://github.com/thetsdz/maze-shooter/blob/master/src/cryptage.c): `src/cryptage.c`
- [LAN gameplay](https://github.com/thetsdz/maze-shooter/blob/master/src/multijoueur.c): `src/multijoueur.c`
- [Sockets and discovery](https://github.com/thetsdz/maze-shooter/blob/master/src/reseau.c): `src/reseau.c`

### Other components

- **Player**
- **LAN peer**

## Connections

- Player → Game loop: starts play
- Game loop → Main menu: dispatches screens (evidence: `src/main.c`)
- Main menu → Game loop: selects screen (evidence: `src/menu.c`)
- Game loop → Game options: opens options (evidence: `src/main.c`)
- Game loop → Maze generation: starts maze (evidence: `src/main.c`)
- Game loop → Game-state update: updates state (evidence: `src/main.c`)
- Game-state update → Player control: updates player (evidence: `src/updategame.c`)
- Game-state update → Bot AI: updates bots (evidence: `src/updategame.c`)
- Game-state update → Boss combat: updates boss (evidence: `src/updategame.c`)
- Game-state update → Projectile combat: updates shots (evidence: `src/updategame.c`)
- Game-state update → Chests and pickups: updates chests (evidence: `src/updategame.c`)
- Bot AI → Pathfinding: finds route (evidence: `src/bot.c`)
- Bot AI → Weapon handling: uses weapons (evidence: `src/bot.c`)
- Player control → Weapon handling: handles weapons (evidence: `src/player.c`)
- Projectile combat → Bot AI: checks targets (evidence: `src/projectile.c`)
- Game loop → End screens: shows outcome (evidence: `src/main.c`)
- Game loop → 3D and UI rendering: renders frames (evidence: `src/main.c`)
- 3D and UI rendering → Textures and themes: uses assets (evidence: `src/dessin.c`)
- 3D and UI rendering → Raylib rendering API: draws through (evidence: `src/dessin.c`)
- 3D and UI rendering → Raylib math API: uses math (evidence: `src/dessin.c`)
- Textures and themes → Raylib GL layer: uses GL layer (evidence: `src/texture.c`)
- Game loop → Music and effects: manages audio (evidence: `src/main.c`)
- Game loop → Save and load: saves or loads (evidence: `src/main.c`)
- Save and load → Integrity checksum: checks integrity (evidence: `src/sauvegarde.c`)
- Game loop → LAN gameplay: starts LAN mode (evidence: `src/main.c`)
- LAN gameplay → Sockets and discovery: exchanges packets (evidence: `src/multijoueur.c`)
- LAN peer → Sockets and discovery: connects or discovers
- LAN gameplay → 3D and UI rendering: draws multiplayer (evidence: `src/multijoueur.c`)
