# gathasper15/bachelorproject architecture

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

## Overview

This repository is a Raylib-based 2D game framework with a sample game entry point. Its principal workflow is game startup and execution, with levels and worlds providing the game structure and entities/components defining behavior and rendering. Supporting capabilities include input handling, physics/collision, sprite visuals, and procedural map, Perlin, and Voronoi generation. The source index establishes many module references, but excerpts do not show most runtime calls, so the graph avoids asserting an unverified execution pipeline.

Main entry points: [`Source/Game/World.cpp`](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/World.cpp) (World), [`Source/Context.h`](https://github.com/gathasper15/bachelorproject/blob/main/Source/Context.h) (Update/render context), [`Source/Game/Components/PerlinPlateComponent.hpp`](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/PerlinPlateComponent.hpp) (Perlin plate), [`Source/Game/Components/VoronoiComponent.hpp`](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/VoronoiComponent.hpp) (Voronoi component)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_main["Program entry<br/>[Main.cpp]"]
  node_usergame["Sample game<br/>[UserGame.hpp]"]
  node_game["Game loop<br/>[Game.cpp]"]
  node_context["Update/render context<br/>[Context.h]"]
  node_levelmanager["Level manager<br/>[LevelManager.cpp]"]
end

subgraph group_world["World and Entities"]
  node_level["Level<br/>[Level.cpp]"]
  node_worldmanager["World manager<br/>[WorldManager.cpp]"]
  node_world["World<br/>[World.cpp]"]
  node_entity["Entity<br/>[Entity.cpp]"]
  node_component["Component base<br/>[Component.h]"]
  node_mapcomponent["Map component<br/>[MapComponent.hpp]"]
  node_collidercomponent["Collider component"]
  node_spritecomponent["Sprite component"]
  node_cameracomponent["Camera movement"]
  node_collisionbehavior["Collision behavior"]
end

subgraph group_graphics["Graphics and Generation"]
  node_perlincomponent["Perlin plate"]
  node_voronoicomponent["Voronoi component"]
  node_perlingenerator["Perlin generator<br/>[perlin.cpp]"]
  node_voronoigenerator["Voronoi generator<br/>[VoronoiDiagram.cpp]"]
  node_mapfunctions["Map functions<br/>[MapFunction.hpp]"]
  node_animatedsprite["Animated sprite<br/>[AnimatedSprite.cpp]"]
end

subgraph group_support["Input and Physics"]
  node_input["Input handling<br/>[Input.cpp]"]
  node_physics["Physics body<br/>[Body.cpp]"]
  node_metalshader["Metal compute<br/>[MetalCompute.h]"]
  node_math["Math utilities<br/>[MathLib.h]"]
end

node_developer(("Game developer"))

node_main -->|"names entry factory"| node_usergame
node_game -->|"references manager"| node_worldmanager
node_world -->|"references collider"| node_collidercomponent
node_worldmanager -->|"references world"| node_world
node_world -->|"references entities"| node_entity
node_world -->|"references levels"| node_level
node_world -->|"references bodies"| node_physics
node_entity -->|"uses base type"| node_component
node_context -->|"references input"| node_input
node_context -->|"references manager"| node_levelmanager
node_perlincomponent -->|"imports compute"| node_metalshader
node_perlincomponent -->|"imports generator"| node_perlingenerator
node_voronoicomponent -->|"imports compute"| node_metalshader
node_voronoicomponent -->|"imports generator"| node_voronoigenerator
node_mapcomponent -->|"imports functions"| node_mapfunctions

click node_main "https://github.com/gathasper15/bachelorproject/blob/main/Source/Main.cpp"
click node_usergame "https://github.com/gathasper15/bachelorproject/blob/main/Source/UserGame.hpp"
click node_game "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game.cpp"
click node_context "https://github.com/gathasper15/bachelorproject/blob/main/Source/Context.h"
click node_levelmanager "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/LevelManager.cpp"
click node_level "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Level.cpp"
click node_worldmanager "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/WorldManager.cpp"
click node_world "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/World.cpp"
click node_entity "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Entity.cpp"
click node_component "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Component.h"
click node_mapcomponent "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/MapComponent.hpp"
click node_collidercomponent "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/ColliderComponent.hpp"
click node_spritecomponent "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/SpriteComponent.hpp"
click node_cameracomponent "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/CameraMoveComponent.hpp"
click node_collisionbehavior "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/CollisionBehaviorComponent.hpp"
click node_perlincomponent "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/PerlinPlateComponent.hpp"
click node_voronoicomponent "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/VoronoiComponent.hpp"
click node_perlingenerator "https://github.com/gathasper15/bachelorproject/blob/main/Source/Graphic/perlin.cpp"
click node_voronoigenerator "https://github.com/gathasper15/bachelorproject/blob/main/Source/Graphic/VoronoiDiagram.cpp"
click node_mapfunctions "https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Map/MapFunction.hpp"
click node_animatedsprite "https://github.com/gathasper15/bachelorproject/blob/main/Source/Visuals/AnimatedSprite.cpp"
click node_input "https://github.com/gathasper15/bachelorproject/blob/main/Source/Input/Input.cpp"
click node_physics "https://github.com/gathasper15/bachelorproject/blob/main/Source/Physics/Body.cpp"
click node_metalshader "https://github.com/gathasper15/bachelorproject/blob/main/Source/Shaders/MetalCompute.h"
click node_math "https://github.com/gathasper15/bachelorproject/blob/main/Source/MathLib/MathLib.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_usergame,node_game,node_context,node_levelmanager toneBlue
class node_level,node_worldmanager,node_world,node_entity,node_component,node_mapcomponent,node_collidercomponent,node_spritecomponent,node_cameracomponent,node_collisionbehavior toneAmber
class node_perlincomponent,node_voronoicomponent,node_perlingenerator,node_voronoigenerator,node_mapfunctions,node_animatedsprite toneMint
class node_input,node_physics,node_metalshader,node_math toneRose
class node_developer toneIndigo
```

## Components

### Game Runtime

- [Program entry](https://github.com/gathasper15/bachelorproject/blob/main/Source/Main.cpp): `Source/Main.cpp`
- [Sample game](https://github.com/gathasper15/bachelorproject/blob/main/Source/UserGame.hpp): `Source/UserGame.hpp`
- [Game loop](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game.cpp): `Source/Game.cpp`
- [Update/render context](https://github.com/gathasper15/bachelorproject/blob/main/Source/Context.h): `Source/Context.h`
- [Level manager](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/LevelManager.cpp): `Source/Game/LevelManager.cpp`

### World and Entities

- [Level](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Level.cpp): `Source/Game/Level.cpp`
- [World manager](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/WorldManager.cpp): `Source/Game/WorldManager.cpp`
- [World](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/World.cpp): `Source/Game/World.cpp`
- [Entity](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Entity.cpp): `Source/Game/Entity.cpp`
- [Component base](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Component.h): `Source/Game/Component.h`
- [Map component](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/MapComponent.hpp): `Source/Game/Components/MapComponent.hpp`
- [Collider component](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/ColliderComponent.hpp): `Source/Game/Components/ColliderComponent.hpp`
- [Sprite component](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/SpriteComponent.hpp): `Source/Game/Components/SpriteComponent.hpp`
- [Camera movement](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/CameraMoveComponent.hpp): `Source/Game/Components/CameraMoveComponent.hpp`
- [Collision behavior](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/CollisionBehaviorComponent.hpp): `Source/Game/Components/CollisionBehaviorComponent.hpp`

### Graphics and Generation

- [Perlin plate](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/PerlinPlateComponent.hpp): `Source/Game/Components/PerlinPlateComponent.hpp`
- [Voronoi component](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Components/VoronoiComponent.hpp): `Source/Game/Components/VoronoiComponent.hpp`
- [Perlin generator](https://github.com/gathasper15/bachelorproject/blob/main/Source/Graphic/perlin.cpp): `Source/Graphic/perlin.cpp`
- [Voronoi generator](https://github.com/gathasper15/bachelorproject/blob/main/Source/Graphic/VoronoiDiagram.cpp): `Source/Graphic/VoronoiDiagram.cpp`
- [Map functions](https://github.com/gathasper15/bachelorproject/blob/main/Source/Game/Map/MapFunction.hpp): `Source/Game/Map/MapFunction.hpp`
- [Animated sprite](https://github.com/gathasper15/bachelorproject/blob/main/Source/Visuals/AnimatedSprite.cpp): `Source/Visuals/AnimatedSprite.cpp`

### Input and Physics

- [Input handling](https://github.com/gathasper15/bachelorproject/blob/main/Source/Input/Input.cpp): `Source/Input/Input.cpp`
- [Physics body](https://github.com/gathasper15/bachelorproject/blob/main/Source/Physics/Body.cpp): `Source/Physics/Body.cpp`
- [Metal compute](https://github.com/gathasper15/bachelorproject/blob/main/Source/Shaders/MetalCompute.h): `Source/Shaders/MetalCompute.h`
- [Math utilities](https://github.com/gathasper15/bachelorproject/blob/main/Source/MathLib/MathLib.h): `Source/MathLib/MathLib.h`

### Other components

- **Game developer**

## Connections

- Program entry → Sample game: names entry factory (evidence: `Source/Main.cpp`)
- Game loop → World manager: references manager (evidence: `Source/Game.cpp`)
- World → Collider component: references collider (evidence: `Source/Game/World.cpp`)
- World manager → World: references world (evidence: `Source/Game/WorldManager.cpp`)
- World → Entity: references entities
- World → Level: references levels
- World → Physics body: references bodies
- Entity → Component base: uses base type
- Update/render context → Input handling: references input (evidence: `Source/Context.h`)
- Update/render context → Level manager: references manager (evidence: `Source/Context.h`)
- Perlin plate → Metal compute: imports compute (evidence: `Source/Game/Components/PerlinPlateComponent.hpp`)
- Perlin plate → Perlin generator: imports generator (evidence: `Source/Game/Components/PerlinPlateComponent.hpp`)
- Voronoi component → Metal compute: imports compute (evidence: `Source/Game/Components/VoronoiComponent.hpp`)
- Voronoi component → Voronoi generator: imports generator (evidence: `Source/Game/Components/VoronoiComponent.hpp`)
- Map component → Map functions: imports functions (evidence: `Source/Game/Components/MapComponent.hpp`)
