# minecraftbucuo/gameengine architecture

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

- Interactive diagram: https://gitdiagram.com/minecraftbucuo/gameengine
- Repository: https://github.com/minecraftbucuo/gameengine

## Overview

GameEngine is a C++/SDL3/Box2D framework whose showcased product is a Super Mario game, supporting local single-player and networked multiplayer, plus desktop and Web clients and a headless server. The main flow is launch → engine initialization and scene selection → per-frame scene updates and rendering, or server ticks; scenes coordinate gameplay, physics, and networking. README capabilities are represented using paths from the tree; unsampled subsystem wiring is not asserted beyond documented behavior and visible engine calls.

Main entry points: [`src/GameEngine.cpp`](https://github.com/minecraftbucuo/gameengine/blob/master/src/GameEngine.cpp) (Game engine), [`src/Manager/SceneManager.cpp`](https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/SceneManager.cpp) (Scene manager), [`src/Scene/SuperMarioSceneMultiplayer.cpp`](https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SuperMarioSceneMultiplayer.cpp) (Multiplayer scene), [`src/Render/RendererSDL3.cpp`](https://github.com/minecraftbucuo/gameengine/blob/master/src/Render/RendererSDL3.cpp) (SDL renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and scenes"]
  node_main["Program entry<br/>[main.cpp]"]
  node_engine["Game engine<br/>[GameEngine.cpp]"]
  node_scene_mgr["Scene manager<br/>[SceneManager.cpp]"]
  node_menu["Menu scene<br/>[MenuScene.cpp]"]
  node_settings["Settings scene<br/>[SettingsScene.cpp]"]
  node_single["Single-player scene"]
  node_multi["Multiplayer scene"]
end

subgraph group_gameplay["Gameplay simulation"]
  node_map["Map loading<br/>[MapLoader.cpp]"]
  node_objects["Game objects<br/>[GameObject.cpp]"]
  node_components["Gameplay components<br/>[Component.cpp]"]
  node_controller["Mario controls"]
  node_states["Mario state machine<br/>[StateMachine.cpp]"]
  node_physics["Box2D physics<br/>[PhysicsWorld.cpp]"]
  node_collision["Collision system"]
end

subgraph group_presentation["Client presentation"]
  node_renderer["SDL renderer<br/>[RendererSDL3.cpp]"]
  node_assets["Asset manager<br/>[AssetManager.cpp]"]
  node_animation["Animation frames<br/>[FrameManager.cpp]"]
end

subgraph group_services["Configuration and networking"]
  node_config["Configuration<br/>[ConfigManager.cpp]"]
  node_network["Network manager<br/>[NetworkManager.cpp]"]
  node_transport["TCP transport<br/>[TcpClient.h]"]
end

node_player(("Player"))
node_server(("Game server"))
node_bridge["WebSocket bridge"]

node_player -->|"launches"| node_main
node_main -->|"initializes and starts"| node_engine
node_engine -->|"loads"| node_config
node_engine -->|"loads resources"| node_assets
node_engine -->|"loads frames"| node_animation
node_engine -->|"creates window"| node_renderer
node_engine -->|"creates and updates"| node_scene_mgr
node_scene_mgr -->|"selects scene"| node_menu
node_scene_mgr -->|"selects scene"| node_settings
node_scene_mgr -->|"selects scene"| node_single
node_scene_mgr -->|"selects scene"| node_multi
node_engine -->|"polls events; presents frames"| node_renderer
node_single -->|"loads level"| node_map
node_multi -->|"loads level"| node_map
node_single -->|"runs gameplay"| node_objects
node_multi -->|"runs gameplay"| node_objects
node_objects -->|"uses"| node_components
node_components -->|"includes"| node_controller
node_controller -->|"changes state"| node_states
node_components -->|"simulates bodies"| node_physics
node_physics -->|"reports contacts"| node_collision
node_single -->|"renders scene"| node_renderer
node_multi -->|"renders scene"| node_renderer
node_renderer -->|"gets textures"| node_assets
node_animation -->|"gets texture handles"| node_assets
node_multi -->|"updates session"| node_network
node_network -->|"sends and receives"| node_transport
node_server -->|"connects by TCP"| node_network
node_player -->|"connects directly"| node_network
node_bridge -.->|"forwards WebSocket to TCP"| node_server
node_settings -.->|"edits settings"| node_config

click node_main "https://github.com/minecraftbucuo/gameengine/blob/master/src/main.cpp"
click node_engine "https://github.com/minecraftbucuo/gameengine/blob/master/src/GameEngine.cpp"
click node_scene_mgr "https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/SceneManager.cpp"
click node_menu "https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/MenuScene.cpp"
click node_settings "https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SettingsScene.cpp"
click node_single "https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SuperMarioSceneSingle.cpp"
click node_multi "https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SuperMarioSceneMultiplayer.cpp"
click node_map "https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/MapLoader.cpp"
click node_objects "https://github.com/minecraftbucuo/gameengine/blob/master/src/GameObjects/GameObject.cpp"
click node_components "https://github.com/minecraftbucuo/gameengine/blob/master/src/Components/Component.cpp"
click node_controller "https://github.com/minecraftbucuo/gameengine/blob/master/src/Components/MarioController.cpp"
click node_states "https://github.com/minecraftbucuo/gameengine/blob/master/src/State/StateMachine.cpp"
click node_physics "https://github.com/minecraftbucuo/gameengine/blob/master/src/Physics/PhysicsWorld.cpp"
click node_collision "https://github.com/minecraftbucuo/gameengine/blob/master/src/CollisionSystem.cpp"
click node_renderer "https://github.com/minecraftbucuo/gameengine/blob/master/src/Render/RendererSDL3.cpp"
click node_assets "https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/AssetManager.cpp"
click node_animation "https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/FrameManager.cpp"
click node_config "https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/ConfigManager.cpp"
click node_network "https://github.com/minecraftbucuo/gameengine/blob/master/src/Network/NetworkManager.cpp"
click node_transport "https://github.com/minecraftbucuo/gameengine/blob/master/src/Network/TcpClient.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_engine,node_scene_mgr,node_menu,node_settings,node_single,node_multi toneBlue
class node_map,node_objects,node_components,node_controller,node_states,node_physics,node_collision toneAmber
class node_renderer,node_assets,node_animation,node_server toneMint
class node_config,node_network,node_transport toneRose
class node_player,node_bridge toneIndigo
```

## Components

### Runtime and scenes

- [Program entry](https://github.com/minecraftbucuo/gameengine/blob/master/src/main.cpp): `src/main.cpp`
- [Game engine](https://github.com/minecraftbucuo/gameengine/blob/master/src/GameEngine.cpp): `src/GameEngine.cpp`
- [Scene manager](https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/SceneManager.cpp): `src/Manager/SceneManager.cpp`
- [Menu scene](https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/MenuScene.cpp): `src/Scene/MenuScene.cpp`
- [Settings scene](https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SettingsScene.cpp): `src/Scene/SettingsScene.cpp`
- [Single-player scene](https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SuperMarioSceneSingle.cpp): `src/Scene/SuperMarioSceneSingle.cpp`
- [Multiplayer scene](https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/SuperMarioSceneMultiplayer.cpp): `src/Scene/SuperMarioSceneMultiplayer.cpp`

### Gameplay simulation

- [Map loading](https://github.com/minecraftbucuo/gameengine/blob/master/src/Scene/MapLoader.cpp): `src/Scene/MapLoader.cpp`
- [Game objects](https://github.com/minecraftbucuo/gameengine/blob/master/src/GameObjects/GameObject.cpp): `src/GameObjects/GameObject.cpp`
- [Gameplay components](https://github.com/minecraftbucuo/gameengine/blob/master/src/Components/Component.cpp): `src/Components/Component.cpp`
- [Mario controls](https://github.com/minecraftbucuo/gameengine/blob/master/src/Components/MarioController.cpp): `src/Components/MarioController.cpp`
- [Mario state machine](https://github.com/minecraftbucuo/gameengine/blob/master/src/State/StateMachine.cpp): `src/State/StateMachine.cpp`
- [Box2D physics](https://github.com/minecraftbucuo/gameengine/blob/master/src/Physics/PhysicsWorld.cpp): `src/Physics/PhysicsWorld.cpp`
- [Collision system](https://github.com/minecraftbucuo/gameengine/blob/master/src/CollisionSystem.cpp): `src/CollisionSystem.cpp`

### Client presentation

- [SDL renderer](https://github.com/minecraftbucuo/gameengine/blob/master/src/Render/RendererSDL3.cpp): `src/Render/RendererSDL3.cpp`
- [Asset manager](https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/AssetManager.cpp): `src/Manager/AssetManager.cpp`
- [Animation frames](https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/FrameManager.cpp): `src/Manager/FrameManager.cpp`

### Configuration and networking

- [Configuration](https://github.com/minecraftbucuo/gameengine/blob/master/src/Manager/ConfigManager.cpp): `src/Manager/ConfigManager.cpp`
- [Network manager](https://github.com/minecraftbucuo/gameengine/blob/master/src/Network/NetworkManager.cpp): `src/Network/NetworkManager.cpp`
- [TCP transport](https://github.com/minecraftbucuo/gameengine/blob/master/src/Network/TcpClient.h): `src/Network/TcpClient.h`

### Other components

- **Player**
- **Game server**
- **WebSocket bridge**

## Connections

- Player → Program entry: launches
- Program entry → Game engine: initializes and starts
- Game engine → Configuration: loads
- Game engine → Asset manager: loads resources
- Game engine → Animation frames: loads frames
- Game engine → SDL renderer: creates window
- Game engine → Scene manager: creates and updates
- Scene manager → Menu scene: selects scene
- Scene manager → Settings scene: selects scene
- Scene manager → Single-player scene: selects scene
- Scene manager → Multiplayer scene: selects scene
- Game engine → SDL renderer: polls events; presents frames
- Single-player scene → Map loading: loads level
- Multiplayer scene → Map loading: loads level
- Single-player scene → Game objects: runs gameplay
- Multiplayer scene → Game objects: runs gameplay
- Game objects → Gameplay components: uses
- Gameplay components → Mario controls: includes
- Mario controls → Mario state machine: changes state
- Gameplay components → Box2D physics: simulates bodies
- Box2D physics → Collision system: reports contacts
- Single-player scene → SDL renderer: renders scene
- Multiplayer scene → SDL renderer: renders scene
- SDL renderer → Asset manager: gets textures
- Animation frames → Asset manager: gets texture handles
- Multiplayer scene → Network manager: updates session
- Network manager → TCP transport: sends and receives
- Game server → Network manager: connects by TCP
- Player → Network manager: connects directly
- WebSocket bridge → Game server: forwards WebSocket to TCP
- Settings scene → Configuration: edits settings
