# caliexo/project2 architecture

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

- Interactive diagram: https://gitdiagram.com/caliexo/project2
- Repository: https://github.com/caliexo/project2

## Overview

##### Project type and purpose
- From the file tree and README, we see this is a small C++ desktop game built in Visual Studio (Project2.sln).
- Key files:
- main.cpp – entry point
- Main_Game.cpp / Main_Game.hpp – core game loop and logic
- character&ball.hpp – definitions for game entities
- .bmp, pl.bmp – bitmap assets

##### File structure
- Top-level solution: Project2.sln
- Single Visual Studio project directory (Project2/) containing:
- Source files (.cpp, .hpp) for game logic
- Project file (.vcxproj) and filters for build config
- Bitmap assets in the same folder
- No separate “engine” folder or third-party libs—code is monolithic but follows a basic engine + game structure.

##### README
- README only contains a title (“Project2”) with no further architectural notes.

##### Details
- OS/Win32 API as a base layer if desired.
- That Main_Game.cpp implements the loop calling update/render.
- Call out asset file names under the Data Files node.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers and Components
    subgraph "Application Layer"
        AppHost["Main Application"]:::core
    end

    subgraph "Engine Core"
        GameEngine["Game Engine Core\n(Main_Game)"]:::core
    end

    subgraph "Subsystems"
        Input["Input Subsystem"]:::subsystem
        Rendering["Rendering Subsystem"]:::subsystem
    end

    subgraph "Game Modules"
        Entities["Game Logic Entities"]:::game
        ResourceMgr["Resource Manager"]:::game
    end

    subgraph "Data Files"
        Map["map.bmp"]:::data
        Pl["pl.bmp"]:::data
    end

    OS["OS/Win32 API"]:::external

    %% Relationships
    AppHost -->|"initialize() / shutdown()"| GameEngine
    GameEngine -->|"handleInput() per frame"| Input
    GameEngine -->|"update() per frame"| Entities
    GameEngine -->|"render() per frame"| Rendering
    GameEngine -->|"loadAssets() at startup"| ResourceMgr

    Rendering -->|"load asset"| ResourceMgr
    Entities -->|"load asset"| ResourceMgr
    ResourceMgr -->|"fetch"| Map
    ResourceMgr -->|"fetch"| Pl

    OS --> GameEngine
    OS --> Input
    OS --> Rendering
    OS --> ResourceMgr

    %% Click Events
    click AppHost "https://github.com/caliexo/project2/blob/master/Project2/main.cpp"
    click GameEngine "https://github.com/caliexo/project2/blob/master/Project2/Main_Game.cpp"
    click Entities "https://github.com/caliexo/project2/blob/master/Project2/character&ball.hpp"
    click Map "https://github.com/caliexo/project2/blob/master/Project2/map.bmp"
    click Pl "https://github.com/caliexo/project2/blob/master/Project2/pl.bmp"

    %% Styles
    classDef core fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef subsystem fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef game fill:#FFF9C4,stroke:#F57F17,stroke-width:2px;
    classDef data fill:#EEEEEE,stroke:#757575,stroke-width:2px;
    classDef external fill:#CFD8DC,stroke:#455A64,stroke-width:2px;
```
