# jbetala7/warriorz architecture

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

- Interactive diagram: https://gitdiagram.com/jbetala7/warriorz
- Repository: https://github.com/jbetala7/warriorz

## Overview

##### Project type and purpose
- This is a Unity‐based 2D platformer game (“Warriorz”) composed of multiple Scenes (StartMenu, Tutorial, Level-1, Level-2), Player and Enemy behaviours, Traps, Pickups, and UI menus.
- It uses Unity’s Monobehaviour/component architecture: all game logic lives in C# scripts under Assets/Scripts, assets in corresponding folders, and the Unity Engine drives Scene loading, rendering, physics, audio, input, etc.

##### File structure
- Top-level “Assets” folder subdivides into:
- Animations (Animator controllers + .anim files)
- Prefabs (blueprints for Enemies, Player, Traps, UI, Weapons, Power-ups)
- Scenes (Unity .unity files for each level/menu)
- Scripts (grouped by feature: Camera, Enemy, Health, Level, Menus, Player, Sound, Traps)
- Sound & Sprites (raw assets)
- “Packages” and “ProjectSettings” contain engine/dependency configs. There is also a LoadingSystem.cs for Scene transitions.

##### README for additional insights
- The README confirms the game flow: StartMenu → Tutorial → Level-1 → Level-2 → Win/GameOver.
- Key gameplay features: two Enemy AIs (patrol & shooting), five Trap types, two pickups, three in-game UI menus.
- Tech stack: Unity 2021.1.0f1, standard 2D pipeline, no external servers or microservices.

##### Detail without overthinking
- Major folders as components (Scripts, Prefabs, Scenes, Audio, Animations).
- Drill down one level: show how Scripts map to subsystems and Prefabs.
- Don’t stray into minor utility scripts; focus on the systems that drive game flow, player/enemy behavior, and UI.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Unity Engine"
        direction TB
        SM["Scene Manager\nLoadingSystem"]:::service
        AS["Audio System\nSoundSystem"]:::service
        Input["Player Input\n(Input)"]:::service

        subgraph "Menu Scenes"
            direction TB
            StartMenu["StartMenuScene"]:::scene
            Tutorial["TutorialScene"]:::scene
        end

        subgraph "Gameplay Scenes"
            direction TB
            Level1["Level-1Scene"]:::scene
            Level2["Level-2Scene"]:::scene

            subgraph "Gameplay Subsystems"
                direction TB

                subgraph "Player System"
                    direction TB
                    PM["PlayerMovement"]:::game
                    PA["PlayerAttack"]:::game
                    Resp["Respawn"]:::game
                    FB["Fireball"]:::game
                end

                subgraph "Enemy System"
                    direction TB
                    Patrol["Patrol"]:::game
                    ShootE["ShootFireballs"]:::game
                    Sword["Sword"]:::game
                    Holder["FireballHolder"]:::game
                end

                subgraph "Trap System"
                    direction TB
                    ArrowT["ArrowTrap"]:::game
                    FireT["FireTrap"]:::game
                    MB["MovingBlade\nTrapDamage"]:::game
                    MP["MovingPlatform"]:::game
                    ShootT["Shoot"]:::game
                    Spike["SpikeHead"]:::game
                end

                subgraph "Pickup System"
                    direction TB
                    EL["ExtraLife"]:::game
                    Health["Health\nHealthBar"]:::game
                end

                subgraph "Camera System"
                    direction TB
                    Follow["CameraFollow"]:::game
                    Bounds["CameraBounds"]:::game
                end

                subgraph "Level Manager"
                    direction TB
                    LevelMgr["Level"]:::game
                    Door["Door"]:::game
                    Finish["Finish"]:::game
                end

                subgraph "UI System"
                    direction TB
                    MainM["MainMenu"]:::ui
                    PauseM["PauseMenu"]:::ui
                    GameOver["GameOverMenu"]:::ui
                    WinM["WinMenu"]:::ui
                    WinT["WinTrigger"]:::ui
                end

            end

            subgraph "Prefabs"
                direction TB
                PlayerPF["Player.prefab"]:::prefab
                EnemyPF["Enemy Prefabs"]:::prefab
                TrapsPF["Trap Prefabs"]:::prefab
                PowerPF["PowerUp Prefabs"]:::prefab
                UIPF["UI Prefabs"]:::prefab
            end

        end
    end

    %% Connections
    SM --> StartMenu
    SM --> Tutorial
    SM --> Level1
    SM --> Level2
    Input --> PM
    PM --> PA
    PA --> FB
    FB --> Patrol
    PM --> ArrowT
    PM --> Patrol
    Patrol -->|"damage"| Health
    ArrowT -->|"damage"| Health
    EL --> Health
    Health -->|"update UI"| MainM
    WinT --> SM
    Follow -->|"follows"| PM
    Finish --> WinT
    AS --> PM
    AS --> Patrol
    AS --> ArrowT
    AS --> EL
    AS --> MainM
    AS --> GameOver
    AS --> WinM

    %% Click Events
    click SM "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/LoadingSystem.cs"
    click AS "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Sound/SoundSystem.cs"
    click StartMenu "https://github.com/jbetala7/warriorz/blob/main/Assets/Scenes/StartMenu.unity"
    click Tutorial "https://github.com/jbetala7/warriorz/blob/main/Assets/Scenes/Tutorial.unity"
    click Level1 "https://github.com/jbetala7/warriorz/blob/main/Assets/Scenes/Level-1.unity"
    click Level2 "https://github.com/jbetala7/warriorz/blob/main/Assets/Scenes/Level-2.unity"
    click PM "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Player/PlayerMovement.cs"
    click PA "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Player/PlayerAttack.cs"
    click Resp "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Player/Respawn.cs"
    click FB "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Player/Fireball.cs"
    click Patrol "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Enemy/Patrol.cs"
    click ShootE "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Enemy/ShootFireballs.cs"
    click Sword "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Enemy/Sword.cs"
    click Holder "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Enemy/FireballHolder.cs"
    click ArrowT "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Traps/ArrowTrap.cs"
    click FireT "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Traps/FireTrap.cs"
    click MB "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Traps/MoveSideways.cs"
    click MP "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Traps/MovingPlatform.cs"
    click ShootT "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Traps/Shoot.cs"
    click Spike "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Traps/SpikeHead.cs"
    click EL "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Health/ExtraLife.cs"
    click Health "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Health/Health.cs"
    click Follow "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Camera/CameraFollow.cs"
    click Bounds "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Camera/CameraBounds.cs"
    click LevelMgr "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Level/Level.cs"
    click Door "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Level/Door.cs"
    click Finish "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Finish.cs"
    click MainM "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Menus/MainMenu.cs"
    click PauseM "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Menus/PauseMenu.cs"
    click GameOver "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Menus/GameOverMenu.cs"
    click WinM "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Menus/WinMenu.cs"
    click WinT "https://github.com/jbetala7/warriorz/blob/main/Assets/Scripts/Menus/WinTrigger.cs"

    %% Styles
    classDef engine fill:#eeeeee,stroke:#444,stroke-width:2px,color:#000;
    classDef service fill:#DDA0DD,stroke:#933,stroke-width:1px,color:#000;
    classDef scene fill:#ADD8E6,stroke:#036,stroke-width:1px,color:#000;
    classDef game fill:#87CEFA,stroke:#036,stroke-width:1px,color:#000;
    classDef ui fill:#90EE90,stroke:#060,stroke-width:1px,color:#000;
    classDef prefab fill:#FFA500,stroke:#F70,stroke-width:1px,color:#000;
```
