# colinvandermeer/feedbluebell architecture

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

- Interactive diagram: https://gitdiagram.com/colinvandermeer/feedbluebell
- Repository: https://github.com/colinvandermeer/feedbluebell

## Overview

##### Main Components
- Game Scenes and Logic Modules:
- Core Game Loop: The “Game.tscn” and “Game.gd” files embody the central gameplay scene and loop.
- UI and Navigation Scenes: “Menu.tscn/Game.gd”, “Tutorial.tscn”, “Credits.tscn”, “Leaderboard.tscn” (and their associated GDScript files) manage user input, state transitions, and navigation.
- End States: “GameOver.tscn” with “GameOver.gd” to handle end-game scenarios.
- Global Management: “Global.gd” likely acts as a singleton or global state manager, coordinating between scenes.
- In-Game Objects and Elements:
- Characters: Scripts and scenes like “Pig.gd”/“Pig.tscn”, “Food.gd”/“Food.tscn”, “Trash.gd”/“Trash.tscn”, and additional scene objects such as “AnimatedSprite.gd” for animations.
- Other Game Elements: “SpawnPosition.gd” for spawns, “LeaderboardEntry.gd” for score display.
- Assets and Resources:
- Visual Assets: Characters (organized in assets/characters) and GUI elements (assets/gui).
- Audio: Music and sound effects in the assets/music and assets/sfx directories.
- Fonts, Shaders, and Themes: Managed by “assets/fonts”, “assets/shaders”, and “Theme.tres”.
- Configuration:
- Project-level files such as “project.godot”, “default_env.tres”, and “default_bus_layout.tres” define global environment and audio bus settings.

##### Relationships and Interactions
- From the Menu to the Game scene.
- From the Game scene to the GameOver screen when criteria are met.
- Options to navigate to Tutorial, Credits, or Leaderboard screens from the main Menu.
- Global and Shared Data: Highlight the role of “Global.gd” which should be connected to various scenes to handle shared state, settings, or score keeping.
- UI & Asset Incorporation: Show that various scenes load and display assets (e.g., characters, audio, fonts, shaders) which are maintained in separate directories.

##### Architectural Patterns or Design Principles
- Scene-Based Modular Design: Emphasize the usage of Godot’s scene system to break down the game’s functionality into modular components (UI screens, gameplay, audio, etc.).
- Separation of Concerns: Different scripts and scene files for game logic, UI navigation, and resource management indicate a clear separation.
- Resource Management: Externalizing assets (sprites, audio, fonts, shaders) encourages reusability and easier updates.

##### Relevant Technologies
- Godot Engine: Indicated by “project.godot”, “.tscn” scene files, and “.gd” scripts.
- GDScript: Used extensively for game logic.
- Audio and Visual Assets: Managed using Godot’s resource types (such as “.tres” files for fonts, shaders, and character frames).

- Center: Global Manager (Global.gd) connecting to:
- Game Scene (Game.tscn & Game.gd)
- Includes subcomponents like Pig, Food, Trash, etc.
- UI Components:
- Menu, Credits, Tutorial, Leaderboard, GameOver screens.
- Side Components:
- Assets Module: Visual (characters, GUI), Audio (music, sound effects), Fonts/Shaders.
- Configuration & Environment: Project.godot, default environment, audio bus layout.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Game Infrastructure"
        GlobalManager["Global Manager (Global.gd)"]:::global
        CoreGame["Core Game Loop (Game.tscn & Game.gd)"]:::core
        ProjectConfig["Project Config (project.godot, default_env.tres, default_bus_layout.tres)"]:::config
        GlobalManager --> CoreGame
        ProjectConfig --> GlobalManager
    end

    subgraph "UI Components"
        Menu["Menu (Menu.tscn & Menu.gd)"]:::ui
        Tutorial["Tutorial (Tutorial.tscn & Tutorial.gd)"]:::ui
        Credits["Credits (Credits.tscn & Credits.gd)"]:::ui
        Leaderboard["Leaderboard (Leaderboard.tscn & Leaderboard.gd)"]:::ui
        GameOver["GameOver (GameOver.tscn & GameOver.gd)"]:::ui
        GlobalManager --> Menu
        GlobalManager --> Tutorial
        GlobalManager --> Credits
        GlobalManager --> Leaderboard
        GlobalManager --> GameOver
        Menu --> CoreGame
        Menu --> Tutorial
        Menu --> Credits
        Menu --> Leaderboard
        CoreGame --> GameOver
    end

    subgraph "In-Game Objects"
        Pig["Pig (Pig.tscn & Pig.gd)"]:::object
        Food["Food (Food.tscn & Food.gd)"]:::object
        Trash["Trash (Trash.tscn & Trash.gd)"]:::object
        AnimatedSprite["Animated Sprite (AnimatedSprite.gd)"]:::object
        SpawnPos["Spawn Position (SpawnPosition.gd)"]:::object
        LeaderboardEntry["Leaderboard Entry (LeaderboardEntry.gd)"]:::object
        CoreGame --> Pig
        CoreGame --> Food
        CoreGame --> Trash
        CoreGame --> AnimatedSprite
        CoreGame --> SpawnPos
        CoreGame --> LeaderboardEntry
    end

    subgraph "Assets & Resources"
        VisualAssets["Visual Assets (assets/characters, assets/gui)"]:::asset
        AudioAssets["Audio Assets (assets/music, assets/sfx)"]:::asset
        FontsShaders["Fonts & Shaders (assets/fonts, assets/shaders, Theme.tres)"]:::asset
        VisualAssets --- CoreGame
        AudioAssets --- CoreGame
        FontsShaders --- CoreGame
        VisualAssets --- Menu
        AudioAssets --- Menu
        FontsShaders --- Menu
        VisualAssets --- Tutorial
        AudioAssets --- Tutorial
        FontsShaders --- Tutorial
        VisualAssets --- Credits
        AudioAssets --- Credits
        FontsShaders --- Credits
        VisualAssets --- Leaderboard
        AudioAssets --- Leaderboard
        FontsShaders --- Leaderboard
    end

    click GlobalManager "https://github.com/colinvandermeer/feedbluebell/blob/main/Global.gd"
    click CoreGame "https://github.com/colinvandermeer/feedbluebell/blob/main/Game.tscn & Game.gd"
    click ProjectConfig "https://github.com/colinvandermeer/feedbluebell/blob/main/project.godot"
    click Menu "https://github.com/colinvandermeer/feedbluebell/blob/main/Menu.tscn & Menu.gd"
    click Tutorial "https://github.com/colinvandermeer/feedbluebell/blob/main/Tutorial.tscn & Tutorial.gd"
    click Credits "https://github.com/colinvandermeer/feedbluebell/blob/main/Credits.tscn & Credits.gd"
    click Leaderboard "https://github.com/colinvandermeer/feedbluebell/blob/main/Leaderboard.tscn & Leaderboard.gd"
    click GameOver "https://github.com/colinvandermeer/feedbluebell/blob/main/GameOver.tscn & GameOver.gd"
    click Pig "https://github.com/colinvandermeer/feedbluebell/blob/main/Pig.tscn & Pig.gd"
    click Food "https://github.com/colinvandermeer/feedbluebell/blob/main/Food.tscn & Food.gd"
    click Trash "https://github.com/colinvandermeer/feedbluebell/blob/main/Trash.tscn & Trash.gd"
    click AnimatedSprite "https://github.com/colinvandermeer/feedbluebell/blob/main/AnimatedSprite.gd"
    click SpawnPos "https://github.com/colinvandermeer/feedbluebell/blob/main/SpawnPosition.gd"
    click LeaderboardEntry "https://github.com/colinvandermeer/feedbluebell/blob/main/LeaderboardEntry.gd"
    click VisualAssets "https://github.com/colinvandermeer/feedbluebell/tree/main/assets/characters"
    click AudioAssets "https://github.com/colinvandermeer/feedbluebell/tree/main/assets/music"
    click FontsShaders "https://github.com/colinvandermeer/feedbluebell/tree/main/assets/fonts"

    classDef global fill:#F9D162,stroke:#000,stroke-width:2px;
    classDef core fill:#A0E7E5,stroke:#000,stroke-width:2px;
    classDef ui fill:#B4F8C8,stroke:#000,stroke-width:2px;
    classDef object fill:#FFAEBC,stroke:#000,stroke-width:2px;
    classDef asset fill:#C1C8E4,stroke:#000,stroke-width:2px;
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
