# bruno-pezzolo/ggj2016-therapy architecture

> Architecture diagram of the GitHub repository bruno-pezzolo/ggj2016-therapy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bruno-pezzolo/ggj2016-therapy
- Repository: https://github.com/bruno-pezzolo/ggj2016-therapy

## Overview

##### Main Components
- Scenes – there are multiple scenes such as “Splash”, “Scene 1”, “Scene 2”, “Scene 3”, and “Scene 4”. Each scene can be represented as a module/state of the overall game.
- Game Logic & Behavior Scripts – present in various folders (Assets/Scripts, Assets/Scene 1/Scripts, etc.). These include components for player controls, collisions, audio triggers, and level-specific interactions.
- Prefabs – reusable game objects (e.g., Car, Player, AudioPoint, TraumaSource) that are used across scenes.
- Audio/Multimedia Assets – that supply sound effects and background audio (scene-specific sounds under each scene folder, Materials for visuals, etc.).

##### Relationships and Interactions
- The Unity Engine sits at the heart, managing the lifecycle of Scenes and game objects (actors).
- The Splash Scene typically acts as the introductory module that triggers transitions to the main game scenes.
- Each scene hosts its own set of scripts that handle specific game logic. For example, Scene 1 has scripts like DadStep1.cs, DadStep2.cs, etc., indicating a narrative or step-by-step progression.
- The game objects (created from prefabs) are linked to behavior scripts (such as CarMovementScript, PlayerInteraction, ProximitySensorScript) and interact through Unity’s event system.
- Audio is integrated across scenes (notably different folders for sounds per scene), which ties into both the prefabs and the game logic through dedicated sound manager scripts.
- There’s interdependency with Standard Assets libraries that manage character controls, camera behavior, input, and physics.

##### Architectural Patterns and Design Principles
- Component-based architecture is central. Each game object is composed of one or more components (script behaviors, audio sources, colliders, etc.), which should be clearly noted.
- The game follows a scene-based state management approach; each scene is essentially a level or a narrative component.
- Use of prefabs indicates reuse and an emphasis on maintainability.
- The segregation of scene-specific assets and global utilities (via the Standard Assets folder) shows a separation of concerns.

##### Relevant Technologies and Frameworks
- Unity Engine
- C# scripting (for gameplay, collision, interaction, and audio management)
- Unity’s built-in modules for physics, audio, and scene management
- Third-party or standard libraries for cross-platform input (as seen in the Assets/Editor/CrossPlatformInput and Standard Assets/CrossPlatformInput)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Engine and Configuration
    UE("Unity Engine"):::engine
    PS("ProjectSettings"):::engine
    UE --> PS

    %% Scenes Group
    subgraph "Scenes"
        SP("Splash Scene"):::scene
        S1("Scene 1 Module"):::scene
        S1B("Scene 1 Before"):::scene
        S1A("Scene 1 After"):::scene
        S2("Scene 2 Module"):::scene
        S3("Scene 3 Module"):::scene
        S4("Scene 4 Module"):::scene
    end

    %% Scene Details Group
    subgraph "Scene Details"
        %% Splash Scene details
        SP_File("Scene File: Splash.unity"):::detail
        SP_Script("Script: SplashScript.cs"):::detail

        %% Scene 1 Module details
        S1_File("Scene File: Scene 1.unity"):::detail
        S1_Scripts("Scripts Folder: Scene 1/Scripts"):::detail
        S1_Audio("Audio Folder: Scene 1/Sounds"):::detail

        %% Scene 1 Before details
        S1B_File("Scene File: Scene 1 Before.unity"):::detail
        S1B_Audio("Audio Folder: Scene 1 Before/Sounds"):::detail

        %% Scene 1 After details
        S1A_File("Scene File: Scene 1 After.unity"):::detail
        S1A_Audio("Audio Folder: Scene 1 After/Sounds"):::detail

        %% Scene 2 Module details
        S2_File("Scene File: Scene 2.unity"):::detail
        S2_Scripts("Scripts Folder: Scene 2/Scripts"):::detail
        S2_Audio("Audio Folder: Scene 2/Sounds"):::detail

        %% Scene 3 Module details
        S3_File("Scene File: Scene 3.unity"):::detail
        S3_Scripts("Scripts Folder: Scene 3/Scripts"):::detail
        S3_Prefab("Prefab: TraumaSource.prefab"):::detail
        S3_Audio("Audio Folder: Scene 3/Sounds"):::detail

        %% Scene 4 Module details
        S4_File("Scene File: Scene 4.unity"):::detail
        S4_Scripts("Scripts Folder: Scene 4/Scripts"):::detail
        S4_Audio("Audio Folder: Scene 4/Sounds"):::detail
    end

    %% Global Assets Group
    subgraph "Global Assets"
        GS("Global Scripts & Behavior: Assets/Scripts & others"):::global
        GP("Global Prefabs: Assets/Prefabs"):::global
        MAT("Materials: Splash-16by9.mat"):::global
    end

    %% Standard Assets & Third Party Libraries Group
    subgraph "Standard Assets & Libraries"
        SA("Standard Assets: Assets/Standard Assets"):::std
        CP("CrossPlatformInput: Assets/Editor/CrossPlatformInput"):::std
    end

    %% Engine triggers scene lifecycle
    UE --> SP
    UE --> S1
    UE --> S1B
    UE --> S1A
    UE --> S2
    UE --> S3
    UE --> S4

    %% Connect Scenes to their details
    SP --> SP_File
    SP --> SP_Script

    S1 --> S1_File
    S1 --> S1_Scripts
    S1 --> S1_Audio

    S1B --> S1B_File
    S1B --> S1B_Audio

    S1A --> S1A_File
    S1A --> S1A_Audio

    S2 --> S2_File
    S2 --> S2_Scripts
    S2 --> S2_Audio

    S3 --> S3_File
    S3 --> S3_Scripts
    S3 --> S3_Prefab
    S3 --> S3_Audio

    S4 --> S4_File
    S4 --> S4_Scripts
    S4 --> S4_Audio

    %% Scene Transitions (Lifecycle Flow)
    SP_File -->|"triggers"| S1_File
    S1_File -->|"transitions"| S2_File
    S2_File -->|"transitions"| S3_File
    S3_File -->|"transitions"| S4_File

    %% Global interdependencies
    S1_Scripts --> GS
    S2_Scripts --> GS
    S3_Scripts --> GS
    S4_Scripts --> GS
    GS -->|"controls"| S3_Prefab
    GP --> GS

    %% Standard Assets integration
    GS --> SA
    GS --> CP

    %% Engine initializing globals and libraries
    UE --> GS
    UE --> SA
    UE --> CP

    %% Click Events for Component Mapping
    click SP_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Splash/Splash.unity"
    click SP_Script "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Splash/SplashScript.cs"
    click S1_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 1.unity"
    click S1_Scripts "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 1/Scripts"
    click S1_Audio "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 1/Sounds"
    click S1B_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 1 Before.unity"
    click S1B_Audio "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 1 Before/Sounds"
    click S1A_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 1 After.unity"
    click S1A_Audio "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 1 After/Sounds"
    click S2_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 2.unity"
    click S2_Scripts "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 2/Scripts"
    click S2_Audio "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 2/Sounds"
    click S3_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 3.unity"
    click S3_Scripts "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 3/Scripts"
    click S3_Prefab "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 3/Prefabs/TraumaSource.prefab"
    click S3_Audio "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 3/Sounds"
    click S4_File "https://github.com/bruno-pezzolo/ggj2016-therapy/blob/master/Assets/Scene 4.unity"
    click S4_Scripts "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 4/Scripts"
    click S4_Audio "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scene 4/Sounds"
    click GS "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Scripts"
    click GP "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Prefabs"
    click MAT "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Materials"
    click SA "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Standard Assets"
    click CP "https://github.com/bruno-pezzolo/ggj2016-therapy/tree/master/Assets/Editor/CrossPlatformInput"

    %% Styles
    classDef engine fill:#7FFFD4,stroke:#000,stroke-width:2px;
    classDef scene fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef detail fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef global fill:#FFA07A,stroke:#000,stroke-width:2px;
    classDef std fill:#DDA0DD,stroke:#000,stroke-width:2px;
```
