# alanparesys/minestorm architecture

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

- Interactive diagram: https://gitdiagram.com/alanparesys/minestorm
- Repository: https://github.com/alanparesys/minestorm

## Overview

MineStorm is a Raylib arcade shooter. The player starts at the title screen, enters gameplay, steers and fires the ship, fights enemy waves that advance through levels, and can pause or reach game over. Game logic also covers enemy variants, collision handling, bullets, and explosion effects; custom 2D geometry supports those mechanics. The sampled game code explicitly updates enemies and the mothership. Other connections are limited to relationships documented by the README or shown by the source index; unsampled details are not assumed.

Main entry points: [`Code/src/game.c`](https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c) (Screens and menus), [`Code/src/collision2D.c`](https://github.com/alanparesys/minestorm/blob/main/Code/src/collision2D.c) (Collision detection), [`Code/src/enemy.c`](https://github.com/alanparesys/minestorm/blob/main/Code/src/enemy.c) (Enemy waves), [`Code/src/rectangle2D.c`](https://github.com/alanparesys/minestorm/blob/main/Code/src/rectangle2D.c) (2D shapes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Game flow"]
  node_entry["Program entry<br/>[main.c]"]
  node_screens["Screens and menus<br/>[game.c]"]
  node_progression["Lives and levels<br/>[game.c]"]
end

subgraph group_combat["Combat simulation"]
  node_ship["Ship controls<br/>[game.c]"]
  node_enemies["Enemy waves<br/>[enemy.c]"]
  node_bullets["Player and enemy bullets<br/>[bullet.c]"]
end

subgraph group_geometry["2D geometry"]
  node_collisions["Collision detection<br/>[collision2D.c]"]
  node_shapes["2D shapes<br/>[rectangle2D.c]"]
  node_polygons["Polygon geometry<br/>[polygone2D.c]"]
  node_spheres["Sphere geometry<br/>[sphere2D.c]"]
  node_vectors["Vector math<br/>[vector2D.c]"]
  node_aabb["Axis-aligned bounds<br/>[aabb2D.c]"]
end

subgraph group_presentation["Rendering and assets"]
  node_explosions["Explosion effects<br/>[explosion.c]"]
  node_assets["Game assets<br/>[struct.h]"]
  node_raylib["Raylib runtime<br/>[raylib.h]"]
  node_assetfiles["Images and sounds"]
end

node_player(("Player"))

node_player -->|"chooses and controls"| node_screens
node_entry -->|"starts game"| node_screens
node_screens -->|"updates gameplay"| node_ship
node_screens -->|"updates enemies"| node_enemies
node_screens -->|"advances levels"| node_progression
node_ship -.->|"fires shots"| node_bullets
node_enemies -.->|"fires shots"| node_bullets
node_screens -.->|"updates effects"| node_explosions
node_screens -.->|"checks collisions"| node_collisions
node_enemies -.->|"uses hitboxes"| node_collisions
node_collisions -->|"uses bounds"| node_shapes
node_collisions -->|"uses polygons"| node_polygons
node_collisions -->|"uses spheres"| node_spheres
node_collisions -->|"uses bounds"| node_aabb
node_shapes -->|"uses vectors"| node_vectors
node_polygons -->|"uses vectors"| node_vectors
node_spheres -->|"uses vectors"| node_vectors
node_aabb -->|"converts rectangles"| node_shapes
node_screens -.->|"renders and reads input"| node_raylib
node_screens -->|"uses game assets"| node_assets
node_assets -.->|"references media"| node_assetfiles
node_explosions -.->|"draws animation"| node_raylib

click node_entry "https://github.com/alanparesys/minestorm/blob/main/Code/src/main.c"
click node_screens "https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c"
click node_progression "https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c"
click node_ship "https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c"
click node_enemies "https://github.com/alanparesys/minestorm/blob/main/Code/src/enemy.c"
click node_bullets "https://github.com/alanparesys/minestorm/blob/main/Code/src/bullet.c"
click node_collisions "https://github.com/alanparesys/minestorm/blob/main/Code/src/collision2D.c"
click node_explosions "https://github.com/alanparesys/minestorm/blob/main/Code/src/explosion.c"
click node_shapes "https://github.com/alanparesys/minestorm/blob/main/Code/src/rectangle2D.c"
click node_polygons "https://github.com/alanparesys/minestorm/blob/main/Code/src/polygone2D.c"
click node_spheres "https://github.com/alanparesys/minestorm/blob/main/Code/src/sphere2D.c"
click node_vectors "https://github.com/alanparesys/minestorm/blob/main/Code/src/vector2D.c"
click node_aabb "https://github.com/alanparesys/minestorm/blob/main/Code/src/aabb2D.c"
click node_assets "https://github.com/alanparesys/minestorm/blob/main/Code/include/struct.h"
click node_raylib "https://github.com/alanparesys/minestorm/blob/main/Library/include/raylib/raylib.h"
click node_assetfiles "https://github.com/alanparesys/minestorm/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_screens,node_progression toneBlue
class node_ship,node_enemies,node_bullets toneAmber
class node_collisions,node_shapes,node_polygons,node_spheres,node_vectors,node_aabb toneMint
class node_explosions,node_assets,node_raylib,node_assetfiles toneRose
class node_player toneIndigo
```

## Components

### Game flow

- [Program entry](https://github.com/alanparesys/minestorm/blob/main/Code/src/main.c): `Code/src/main.c`
- [Screens and menus](https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c): `Code/src/game.c`
- [Lives and levels](https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c): `Code/src/game.c`

### Combat simulation

- [Ship controls](https://github.com/alanparesys/minestorm/blob/main/Code/src/game.c): `Code/src/game.c`
- [Enemy waves](https://github.com/alanparesys/minestorm/blob/main/Code/src/enemy.c): `Code/src/enemy.c`
- [Player and enemy bullets](https://github.com/alanparesys/minestorm/blob/main/Code/src/bullet.c): `Code/src/bullet.c`

### 2D geometry

- [Collision detection](https://github.com/alanparesys/minestorm/blob/main/Code/src/collision2D.c): `Code/src/collision2D.c`
- [2D shapes](https://github.com/alanparesys/minestorm/blob/main/Code/src/rectangle2D.c): `Code/src/rectangle2D.c`
- [Polygon geometry](https://github.com/alanparesys/minestorm/blob/main/Code/src/polygone2D.c): `Code/src/polygone2D.c`
- [Sphere geometry](https://github.com/alanparesys/minestorm/blob/main/Code/src/sphere2D.c): `Code/src/sphere2D.c`
- [Vector math](https://github.com/alanparesys/minestorm/blob/main/Code/src/vector2D.c): `Code/src/vector2D.c`
- [Axis-aligned bounds](https://github.com/alanparesys/minestorm/blob/main/Code/src/aabb2D.c): `Code/src/aabb2D.c`

### Rendering and assets

- [Explosion effects](https://github.com/alanparesys/minestorm/blob/main/Code/src/explosion.c): `Code/src/explosion.c`
- [Game assets](https://github.com/alanparesys/minestorm/blob/main/Code/include/struct.h): `Code/include/struct.h`
- [Raylib runtime](https://github.com/alanparesys/minestorm/blob/main/Library/include/raylib/raylib.h): `Library/include/raylib/raylib.h`
- [Images and sounds](https://github.com/alanparesys/minestorm/tree/main/Assets): `Assets`

### Other components

- **Player**

## Connections

- Player → Screens and menus: chooses and controls (evidence: `README.md`)
- Program entry → Screens and menus: starts game (evidence: `Code/src/main.c`)
- Screens and menus → Ship controls: updates gameplay (evidence: `Code/src/game.c`)
- Screens and menus → Enemy waves: updates enemies (evidence: `Code/src/game.c`)
- Screens and menus → Lives and levels: advances levels (evidence: `Code/src/game.c`)
- Ship controls → Player and enemy bullets: fires shots
- Enemy waves → Player and enemy bullets: fires shots
- Screens and menus → Explosion effects: updates effects
- Screens and menus → Collision detection: checks collisions
- Enemy waves → Collision detection: uses hitboxes
- Collision detection → 2D shapes: uses bounds
- Collision detection → Polygon geometry: uses polygons
- Collision detection → Sphere geometry: uses spheres
- Collision detection → Axis-aligned bounds: uses bounds
- 2D shapes → Vector math: uses vectors (evidence: `Code/src/rectangle2D.c`)
- Polygon geometry → Vector math: uses vectors (evidence: `Code/src/polygone2D.c`)
- Sphere geometry → Vector math: uses vectors (evidence: `Code/src/sphere2D.c`)
- Axis-aligned bounds → 2D shapes: converts rectangles
- Screens and menus → Raylib runtime: renders and reads input
- Screens and menus → Game assets: uses game assets (evidence: `Code/src/game.c`)
- Game assets → Images and sounds: references media
- Explosion effects → Raylib runtime: draws animation
