# randygaul/game_math_101 architecture

> Architecture diagram of the GitHub repository randygaul/game_math_101, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/randygaul/game_math_101
- Repository: https://github.com/randygaul/game_math_101

## Overview

##### Core Engine Layer
- Represented by tigr.c and tigr.h
- Math Foundation
- Math_101.h as a core component
- As a parallel component to TIGR

##### Game Systems Layer
- Drawing System
- DLL Interface
- Dll.cpp and dll.h as a module for dynamic loading capabilities
- Routine System
- Routine.h for game loop management

##### Asset Management
- Art Resources
- .ase files (charge1, explosion, ship)
- As a top-level resource container

##### Use a Layered Architecture Approach
- Bottom Layer: Core Engine (TIGR + Math)
- Middle Layer: Game Systems
- Top Layer: Assets and Resources

##### Component Relationships
- Bidirectional relationships where appropriate

- [TIGR Graphics Library] <---> [Math 101 Module]

- [Drawing System] ---> [DLL Interface]
- ↑
- [Routine System]

- [Asset Container]
- ↓
- [Drawing System]

##### Documentation Notes
- A small note about the project's purpose (2D math demo)
- Reference the blog post connection
- Relevant build/compilation flows

- The simplicity and elegance of the design
- The clear separation between graphics, math, and game logic
- The asset pipeline flow
- The relationship between different systems

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Assets
        ART[Art Resources]:::assets
        SHIP[Ship Asset]:::asset
        CHARGE[Charge Asset]:::asset
        EXPLOSION[Explosion Asset]:::asset
        
        ART --> SHIP
        ART --> CHARGE
        ART --> EXPLOSION
    end

    subgraph "Game Systems"
        DRAW[Drawing System]:::system
        DLL[DLL Interface]:::system
        ROUTINE[Routine System]:::system
        MAIN[Main Application]:::system

        ROUTINE --> DRAW
        DRAW --> DLL
        MAIN --> ROUTINE
    end

    subgraph "Core Engine"
        TIGR[TIGR Graphics Library]:::core
        MATH[Math Foundation]:::core

        TIGR <--> MATH
    end

    ART --> DRAW
    DRAW --> TIGR
    DLL --> TIGR
    ROUTINE --> MATH

    classDef core fill:#2374ab,stroke:#000,stroke-width:2px,color:#fff
    classDef system fill:#47a025,stroke:#000,stroke-width:2px,color:#fff
    classDef assets fill:#ffb627,stroke:#000,stroke-width:2px,color:#fff
    classDef asset fill:#ffd684,stroke:#000,stroke-width:2px,color:#000

    click TIGR "https://github.com/RandyGaul/game_math_101/blob/main/tigr.c"
    click MATH "https://github.com/RandyGaul/game_math_101/blob/main/math_101.h"
    click DRAW "https://github.com/RandyGaul/game_math_101/blob/main/draw.h"
    click DLL "https://github.com/RandyGaul/game_math_101/blob/main/dll.cpp"
    click ROUTINE "https://github.com/RandyGaul/game_math_101/blob/main/routine.h"
    click ART "https://github.com/RandyGaul/game_math_101/tree/main/art/"
    click SHIP "https://github.com/RandyGaul/game_math_101/blob/main/art/ship.ase"
    click CHARGE "https://github.com/RandyGaul/game_math_101/blob/main/art/charge1.ase"
    click EXPLOSION "https://github.com/RandyGaul/game_math_101/blob/main/art/explosion.ase"
    click MAIN "https://github.com/RandyGaul/game_math_101/blob/main/main.cpp"
```
