# bolesawny7/angrybirds architecture

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

- Interactive diagram: https://gitdiagram.com/bolesawny7/angrybirds
- Repository: https://github.com/bolesawny7/angrybirds

## Overview

##### Project type and purpose
- This is a standalone desktop game: an “Angry Birds” clone implemented in C++ using the SFML (Simple and Fast Multimedia Library) framework.
- The README confirms it’s a full game simulation: game loop, rendering, physics, input handling, audio, UI menus, and asset management.

##### File structure
- Top-level:
- AngryBirds.sln & .vcxproj files: Visual Studio solution and project definitions.
- game source in /AngryBirds: Menu.cpp/.h, Status.cpp/.h, game.cpp; these correspond to UI/menu states and core game logic.
- assets/: fonts, images, sounds—organized by type.
- config.ini: runtime configuration parameters.
- history.txt: likely design notes or changelog.
- No server/backend components—this is a monolithic desktop application.
- Dependencies are managed by SFML (graphics, window, audio, system).

##### README for additional insights
- Very brief: confirms SFML usage.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Libraries
    subgraph "External Libraries"
        direction TB
        SFML_Window["SFML Window"]:::external
        SFML_Graphics["SFML Graphics"]:::external
        SFML_Audio["SFML Audio"]:::external
        SFML_System["SFML System"]:::external
    end

    %% Core Engine
    subgraph "Core Engine" 
        direction TB
        GameLoop["Game Loop"]:::core
        InputHandler["Input Handler"]:::core
        PhysicsEngine["Physics Engine"]:::core
        RenderingEngine["Rendering Engine"]:::core
        AudioEngine["Audio Engine"]:::core
    end

    %% State Management
    subgraph "State Manager" 
        direction TB
        MenuState["Menu State"]:::state
        StatusState["Status State"]:::state
        GameplayState["Gameplay State"]:::state
    end

    %% Resource Management
    subgraph "Resource Manager" 
        direction TB
        AssetLoader["Asset Loader"]:::resource
        ConfigLoader["Configuration Loader"]:::resource
    end

    %% Assets
    subgraph "Assets (File System)" 
        direction TB
        Fonts["assets/fonts/"]:::resource
        Pictures["assets/pics/"]:::resource
        Sounds["assets/sound/"]:::resource
    end

    %% Project & Documentation
    subgraph "Project Definition & Docs"
        direction TB
        VSSln["Visual Studio Solution"]:::docs
        VSProj["Visual Studio Project"]:::docs
        README["README.md"]:::docs
        History["history.txt"]:::docs
    end

    %% Connections
    GameLoop -->|drives| StateManager["State Manager"]
    StateManager -->|activeState| MenuState
    StateManager -->|activeState| StatusState
    StateManager -->|activeState| GameplayState

    GameLoop -->|deltaTime| PhysicsEngine
    GameLoop -->|deltaTime| RenderingEngine
    GameLoop -->|deltaTime| AudioEngine

    InputHandler -->|events| StateManager
    SFML_Window -->|pollEvent| InputHandler

    PhysicsEngine -->|collisionData| GameplayState
    GameplayState -->|updateLogic| PhysicsEngine

    RenderingEngine -->|"Draw(texture)"| GameplayState
    AssetLoader -->|provides textures| RenderingEngine

    AudioEngine -->|"PlaySound"| GameplayState
    AssetLoader -->|provides sounds| AudioEngine

    ConfigLoader -->|configParams| GameLoop
    ConfigLoader -->|configParams| AssetLoader

    Fonts --> AssetLoader
    Pictures --> AssetLoader
    Sounds --> AssetLoader

    SFML_Graphics --> RenderingEngine
    SFML_Audio --> AudioEngine
    SFML_System --> PhysicsEngine

    VSSln --> VSProj
    VSProj -->|includes| GameLoop
    VSProj -->|includes| MenuState
    VSProj -->|includes| StatusState

    README -->|documentation| GameLoop
    History -->|changelog| GameLoop

    %% Click Events
    click GameLoop "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/game.cpp"
    click InputHandler "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/game.cpp"
    click PhysicsEngine "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/game.cpp"
    click RenderingEngine "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/game.cpp"
    click AudioEngine "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/game.cpp"
    click MenuState "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/Menu.cpp"
    click StatusState "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/Status.cpp"
    click GameplayState "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/game.cpp"
    click AssetLoader "https://github.com/bolesawny7/angrybirds/tree/master/assets/"
    click ConfigLoader "https://github.com/bolesawny7/angrybirds/blob/master/config.ini"
    click Fonts "https://github.com/bolesawny7/angrybirds/tree/master/assets/fonts/"
    click Pictures "https://github.com/bolesawny7/angrybirds/tree/master/assets/pics/"
    click Sounds "https://github.com/bolesawny7/angrybirds/tree/master/assets/sound/"
    click VSSln "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds.sln"
    click VSProj "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/AngryBirds.vcxproj"
    click README "https://github.com/bolesawny7/angrybirds/blob/master/README.md"
    click History "https://github.com/bolesawny7/angrybirds/blob/master/AngryBirds/history.txt"

    %% Styles
    classDef core fill:#e0f7fa,stroke:#006064,color:#000
    classDef state fill:#e8f5e9,stroke:#2e7d32,color:#000
    classDef resource fill:#fff3e0,stroke:#ef6c00,color:#000
    classDef external fill:#eceff1,stroke:#607d8b,color:#000
    classDef docs fill:#f3e5f5,stroke:#6a1b9a,color:#000
```
