# cristianf19/bullethell architecture

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

- Interactive diagram: https://gitdiagram.com/cristianf19/bullethell
- Repository: https://github.com/cristianf19/bullethell

## Overview

##### Project type and purpose
- This is a Unity-based 2D “bullet hell” arcade game called BulletHell.
- Core gameplay features: spawning waves of enemies, varied enemy movement patterns, player shooting, pooling for bullets/enemies, health management, main menu and in-game UI.

##### File structure
- Top-level Unity structure:
- Assets/Scenes – Unity Scene files (MainMenu.unity, Game.unity)
- Assets/Prefabs – Reusable game objects (bullets, enemies)
- Assets/Scripts – C# game logic (Entities, Managers, Patterns, Stats)
- Assets/Sprites & TextMesh Pro – Art assets and text rendering plugin
- ProjectSettings & Packages – Build and dependency configuration
- Architectural hints:
- “Manager” classes (PoolManager, SpawnEnemyManager, WaveManager, MenuManager) orchestrate high-level flows.
- Script folders by concern: EnemyMovementPattern, EnemyStats, Menu, etc., implying a component-based design.
- Pool.cs + PoolManager.cs for object reuse (performance).
- Separation of UI (HealthBar, MainMenu) vs. gameplay (Enemy, Bullet, Player).

##### README insights
- Empty in this case; rely solely on directory conventions and file names.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Engine and Plugins
    Unity["Unity Engine Core"]:::external
    TMP["TextMesh Pro"]:::external

    %% Scenes
    subgraph "Scenes"
        MM["Main Menu Scene"]:::scene
        GS["Game Scene"]:::scene
    end

    %% Managers
    subgraph "Managers"
        MenuMgr["MenuManager"]:::manager
        MainMenuCtrl["MainMenu Controller"]:::manager
        PoolMgr["PoolManager"]:::manager
        Pool["Pool<T>"]:::manager
        SpawnMgr["SpawnEnemyManager"]:::manager
        WaveMgr["WaveManager"]:::manager
        SpawnEvt["SpawnEvent"]:::manager
        HealthMgr["HealthManager"]:::manager
    end

    %% Entities and Components
    subgraph "Entities"
        Entity["Entity"]:::entity
        Player["Player"]:::entity
        Enemy["Enemy"]:::entity
        Bullet["Bullet"]:::entity
    end

    subgraph "Shooting"
        Shooter["Shooter"]:::entity
        ShootPattern["ShootPattern"]:::pattern
    end

    subgraph "Movement Patterns"
        EMPInterface["EnemyMovementPattern"]:::pattern
        BombPat["BombPattern"]:::pattern
        StraightPat["StraightPattern"]:::pattern
        ZigZagPat["ZigZagPattern"]:::pattern
    end

    %% UI
    subgraph "UI"
        MainMenuUI["MainMenu UI"]:::ui
        HealthBarUI["HealthBar UI"]:::ui
    end

    %% Assets and Prefabs
    subgraph "Asset Repository"
        Prefabs["Prefab Registry"]:::data
        subgraph "Prefabs"
            BPrefab["Bullet Prefab"]:::prefab
            EStd["Standard Enemy Prefab"]:::prefab
            EBomb["Bomb Enemy Prefab"]:::prefab
            EZig["ZigZag Enemy Prefab"]:::prefab
        end
        Sprites["Sprites & Materials"]:::data
    end

    %% Relationships
    Unity -->|"loads"| MM
    Unity -->|"loads"| GS
    GS -->|"init Managers"| PoolMgr
    GS -->|"init Managers"| WaveMgr
    GS -->|"init Managers"| HealthMgr

    MM -->|"init"| MenuMgr
    MenuMgr -->|"controls"| MainMenuUI
    MainMenuUI -->|"start game"| GS
    MainMenuUI -->|"exit to menu"| MM

    PoolMgr -->|"uses"| Pool
    PoolMgr -->|"manages"| Prefabs
    Prefabs -->|provides| BPrefab
    Prefabs -->|provides| EStd
    Prefabs -->|provides| EBomb
    Prefabs -->|provides| EZig

    WaveMgr -->|"schedules"| SpawnEvt
    SpawnEvt -->|"config for"| SpawnMgr
    SpawnMgr -->|"requests prefab"| PoolMgr
    SpawnMgr -->|"spawns"| Enemy
    EMPInterface -->|"strategy for"| Enemy
    BombPat --> EMPInterface
    StraightPat --> EMPInterface
    ZigZagPat --> EMPInterface

    Player -->|"input to"| Shooter
    Shooter -->|"requests bullet"| PoolMgr
    PoolMgr -->|"provides prefab"| BPrefab
    BPrefab -->|"instantiates"| Bullet

    Bullet -->|"on collision"| Enemy
    Enemy -->|"damage to"| HealthMgr
    HealthMgr -->|"updates"| HealthBarUI
    Enemy -->|"death return"| PoolMgr
    Bullet -->|"offscreen return"| PoolMgr

    %% Click Events
    click MM "https://github.com/cristianf19/bullethell/blob/master/Assets/Scenes/MainMenu.unity"
    click GS "https://github.com/cristianf19/bullethell/blob/master/Assets/Scenes/Game.unity"
    click BPrefab "https://github.com/cristianf19/bullethell/blob/master/Assets/Prefabs/Bullets/bulletPrefab.prefab"
    click EStd "https://github.com/cristianf19/bullethell/blob/master/Assets/Prefabs/Enemies/Enemy.prefab"
    click EBomb "https://github.com/cristianf19/bullethell/blob/master/Assets/Prefabs/Enemies/BombEnemy.prefab"
    click EZig "https://github.com/cristianf19/bullethell/blob/master/Assets/Prefabs/Enemies/EnemyZigZag.prefab"
    click MenuMgr "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Menu/MenuManager.cs"
    click MainMenuCtrl "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/MainMenu/MainMenu.cs"
    click PoolMgr "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/PoolManager.cs"
    click Pool "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Pool.cs"
    click SpawnMgr "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/SpawnEnemyManager.cs"
    click WaveMgr "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/WaveManager.cs"
    click SpawnEvt "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/SpawnEvent.cs"
    click HealthMgr "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/HealthManager.cs"
    click HealthBarUI "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/HealthBar.cs"
    click Entity "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Entity.cs"
    click Player "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Player.cs"
    click Enemy "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Enemy.cs"
    click Bullet "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Bullet.cs"
    click Shooter "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/Shooter.cs"
    click ShootPattern "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/ShootPattern.cs"
    click EMPInterface "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/EnemyMovementPattern/EnemyMovementPattern.cs"
    click BombPat "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/EnemyMovementPattern/BombPattern.cs"
    click StraightPat "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/EnemyMovementPattern/StraightPattern.cs"
    click ZigZagPat "https://github.com/cristianf19/bullethell/blob/master/Assets/Scripts/EnemyMovementPattern/ZigZagPattern.cs"

    %% Styles
    classDef manager fill:#D0E8FF,stroke:#000,stroke-width:1px
    classDef entity fill:#D0FFD6,stroke:#000,stroke-width:1px
    classDef ui fill:#FFE4B5,stroke:#000,stroke-width:1px
    classDef external fill:#EDEDED,stroke:#000,stroke-width:1px
    classDef pattern fill:#F0E68C,stroke:#000,stroke-width:1px
    classDef data fill:#F5F5F5,stroke:#000,stroke-width:1px
    classDef prefab fill:#CFF5E1,stroke:#000,stroke-width:1px
    classDef scene fill:#E3E4FA,stroke:#000,stroke-width:1px
```
