# farthenginer/mikeyengine architecture

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

- Interactive diagram: https://gitdiagram.com/farthenginer/mikeyengine
- Repository: https://github.com/farthenginer/mikeyengine

## Overview

Mikey Engine is a small SDL2-based 2D game engine. A game initializes the runtime, processes SDL events and per-frame updates, then renders ECS entities and particles; game logic can use groups, collisions, and tile maps. The graph preserves the README’s documented animation, audio, text, debug, and effects capabilities. Some subsystem links rely on README documentation or the SOURCE INDEX because their implementation excerpts were not provided.

Main entry points: [`Game/Game.cpp`](https://github.com/farthenginer/mikeyengine/blob/main/Game/Game.cpp) (Game loop), [`ECS/SpriteComponent.h`](https://github.com/farthenginer/mikeyengine/blob/main/ECS/SpriteComponent.h) (Sprite animation), [`ECS/TransformComponent.h`](https://github.com/farthenginer/mikeyengine/blob/main/ECS/TransformComponent.h) (Transform), [`Engine/Components.h`](https://github.com/farthenginer/mikeyengine/blob/main/Engine/Components.h) (Component registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_main["Application entry<br/>[main.cpp]"]
  node_game["Game loop<br/>[Game.cpp]"]
  node_input["Keyboard input"]
end

subgraph group_ecs["Entity components"]
  node_manager["Entity manager<br/>[ECS.h]"]
  node_components["Component registry<br/>[Components.h]"]
  node_transform["Transform"]
  node_sprite["Sprite animation<br/>[SpriteComponent.h]"]
  node_collider["Collider component"]
  node_vector["Vector math<br/>[Vector2D.cpp]"]
end

subgraph group_world["World and effects"]
  node_collision["AABB collision<br/>[Collision.cpp]"]
  node_map["Tile map loader<br/>[Map.cpp]"]
  node_particles["Particle effects"]
  node_trail["Trail effects<br/>[TrailComponent.cpp]"]
end

subgraph group_assets["Assets and presentation"]
  node_assets["Asset manager<br/>[AssetsManager.cpp]"]
  node_textures["Texture operations<br/>[TextureManager.cpp]"]
  node_presentation["Audio and text<br/>[Game.cpp]"]
end

node_developer(("Game developer"))
node_sdl["SDL2 services"]

node_developer -->|"implements game"| node_game
node_main -->|"starts runtime"| node_game
node_game -->|"updates entities"| node_manager
node_game -->|"draws groups"| node_manager
node_game -->|"updates effects"| node_particles
node_game -->|"renders effects"| node_particles
node_manager -->|"hosts components"| node_components
node_components -->|"registers"| node_transform
node_components -->|"registers"| node_sprite
node_components -->|"registers"| node_collider
node_input -->|"controls movement"| node_transform
node_input -->|"toggles debug"| node_game
node_sprite -->|"reads position"| node_transform
node_sprite -->|"fetches texture"| node_assets
node_assets -->|"loads texture"| node_textures
node_sprite -->|"draws sprite"| node_textures
node_collider -->|"reads bounds"| node_transform
node_collision -->|"checks AABB"| node_collider
node_game -->|"uses collision"| node_collision
node_game -->|"loads tile map"| node_map
node_map -->|"creates entities"| node_manager
node_transform -->|"stores vectors"| node_vector
node_game -->|"plays sound"| node_presentation
node_game -->|"initializes runtime"| node_sdl
node_sprite -->|"animates and fades"| node_sprite
node_trail -->|"uses frame timing"| node_game

click node_main "https://github.com/farthenginer/mikeyengine/blob/main/Engine/main.cpp"
click node_game "https://github.com/farthenginer/mikeyengine/blob/main/Game/Game.cpp"
click node_input "https://github.com/farthenginer/mikeyengine/blob/main/Game/KeyboardController.h"
click node_manager "https://github.com/farthenginer/mikeyengine/blob/main/ECS/ECS.h"
click node_components "https://github.com/farthenginer/mikeyengine/blob/main/Engine/Components.h"
click node_transform "https://github.com/farthenginer/mikeyengine/blob/main/ECS/TransformComponent.h"
click node_sprite "https://github.com/farthenginer/mikeyengine/blob/main/ECS/SpriteComponent.h"
click node_collider "https://github.com/farthenginer/mikeyengine/blob/main/ECS/ColliderComponent.h"
click node_collision "https://github.com/farthenginer/mikeyengine/blob/main/Engine/Collision.cpp"
click node_map "https://github.com/farthenginer/mikeyengine/blob/main/Game/Map.cpp"
click node_particles "https://github.com/farthenginer/mikeyengine/blob/main/ECS/ParticleComponent.cpp"
click node_trail "https://github.com/farthenginer/mikeyengine/blob/main/ECS/TrailComponent.cpp"
click node_vector "https://github.com/farthenginer/mikeyengine/blob/main/Engine/Vector2D.cpp"
click node_assets "https://github.com/farthenginer/mikeyengine/blob/main/Managers/AssetsManager.cpp"
click node_textures "https://github.com/farthenginer/mikeyengine/blob/main/Managers/TextureManager.cpp"
click node_presentation "https://github.com/farthenginer/mikeyengine/blob/main/Game/Game.cpp"

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_game,node_input toneBlue
class node_manager,node_components,node_transform,node_sprite,node_collider,node_vector toneAmber
class node_collision,node_map,node_particles,node_trail toneMint
class node_assets,node_textures,node_presentation toneRose
class node_developer,node_sdl toneIndigo
```

## Components

### Game runtime

- [Application entry](https://github.com/farthenginer/mikeyengine/blob/main/Engine/main.cpp): `Engine/main.cpp`
- [Game loop](https://github.com/farthenginer/mikeyengine/blob/main/Game/Game.cpp): `Game/Game.cpp`
- [Keyboard input](https://github.com/farthenginer/mikeyengine/blob/main/Game/KeyboardController.h): `Game/KeyboardController.h`

### Entity components

- [Entity manager](https://github.com/farthenginer/mikeyengine/blob/main/ECS/ECS.h): `ECS/ECS.h`
- [Component registry](https://github.com/farthenginer/mikeyengine/blob/main/Engine/Components.h): `Engine/Components.h`
- [Transform](https://github.com/farthenginer/mikeyengine/blob/main/ECS/TransformComponent.h): `ECS/TransformComponent.h`
- [Sprite animation](https://github.com/farthenginer/mikeyengine/blob/main/ECS/SpriteComponent.h): `ECS/SpriteComponent.h`
- [Collider component](https://github.com/farthenginer/mikeyengine/blob/main/ECS/ColliderComponent.h): `ECS/ColliderComponent.h`
- [Vector math](https://github.com/farthenginer/mikeyengine/blob/main/Engine/Vector2D.cpp): `Engine/Vector2D.cpp`

### World and effects

- [AABB collision](https://github.com/farthenginer/mikeyengine/blob/main/Engine/Collision.cpp): `Engine/Collision.cpp`
- [Tile map loader](https://github.com/farthenginer/mikeyengine/blob/main/Game/Map.cpp): `Game/Map.cpp`
- [Particle effects](https://github.com/farthenginer/mikeyengine/blob/main/ECS/ParticleComponent.cpp): `ECS/ParticleComponent.cpp`
- [Trail effects](https://github.com/farthenginer/mikeyengine/blob/main/ECS/TrailComponent.cpp): `ECS/TrailComponent.cpp`

### Assets and presentation

- [Asset manager](https://github.com/farthenginer/mikeyengine/blob/main/Managers/AssetsManager.cpp): `Managers/AssetsManager.cpp`
- [Texture operations](https://github.com/farthenginer/mikeyengine/blob/main/Managers/TextureManager.cpp): `Managers/TextureManager.cpp`
- [Audio and text](https://github.com/farthenginer/mikeyengine/blob/main/Game/Game.cpp): `Game/Game.cpp`

### Other components

- **Game developer**
- **SDL2 services**

## Connections

- Game developer → Game loop: implements game (evidence: `README.md`)
- Application entry → Game loop: starts runtime (evidence: `Engine/main.cpp`)
- Game loop → Entity manager: updates entities (evidence: `Game/Game.cpp`)
- Game loop → Entity manager: draws groups (evidence: `Game/Game.cpp`)
- Game loop → Particle effects: updates effects (evidence: `Game/Game.cpp`)
- Game loop → Particle effects: renders effects (evidence: `Game/Game.cpp`)
- Entity manager → Component registry: hosts components (evidence: `Engine/Components.h`)
- Component registry → Transform: registers (evidence: `Engine/Components.h`)
- Component registry → Sprite animation: registers (evidence: `Engine/Components.h`)
- Component registry → Collider component: registers (evidence: `Engine/Components.h`)
- Keyboard input → Transform: controls movement (evidence: `README.md`)
- Keyboard input → Game loop: toggles debug (evidence: `Game/KeyboardController.h`)
- Sprite animation → Transform: reads position (evidence: `ECS/SpriteComponent.h`)
- Sprite animation → Asset manager: fetches texture (evidence: `ECS/SpriteComponent.h`)
- Asset manager → Texture operations: loads texture (evidence: `Managers/AssetsManager.cpp`)
- Sprite animation → Texture operations: draws sprite (evidence: `ECS/SpriteComponent.h`)
- Collider component → Transform: reads bounds (evidence: `ECS/ColliderComponent.h`)
- AABB collision → Collider component: checks AABB (evidence: `Engine/Collision.cpp`)
- Game loop → AABB collision: uses collision (evidence: `Game/Game.cpp`)
- Game loop → Tile map loader: loads tile map (evidence: `Game/Game.cpp`)
- Tile map loader → Entity manager: creates entities (evidence: `Game/Map.cpp`)
- Transform → Vector math: stores vectors (evidence: `ECS/TransformComponent.h`)
- Game loop → Audio and text: plays sound (evidence: `Game/Game.cpp`)
- Game loop → SDL2 services: initializes runtime (evidence: `Game/Game.cpp`)
- Sprite animation → Sprite animation: animates and fades (evidence: `ECS/SpriteComponent.h`)
- Trail effects → Game loop: uses frame timing (evidence: `ECS/TrailComponent.cpp`)
