# code-with-l/fruit-saga architecture

> Architecture diagram of the GitHub repository code-with-l/fruit-saga, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/code-with-l/fruit-saga
- Repository: https://github.com/code-with-l/fruit-saga

## Overview

This appears to be a Godot fruit-merging game: the tree suggests a player enters through a title screen, interacts with fruit during gameplay, and receives HUD and effect feedback. The diagram preserves the apparent gameplay, fruit, UI, and effects subsystems. No README content or source excerpts were provided, so connections inferred from names and file layout are dashed and have no evidence path; implementation details and exact call ownership remain unverified.

Main entry points: [`scripts/fruit/Fruit.gd`](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/Fruit.gd) (Fruit behavior), [`autoloads/GameFX.gd`](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/GameFX.gd) (Game effects), [`scenes/Main.tscn`](https://github.com/code-with-l/fruit-saga/blob/main/scenes/Main.tscn) (Main scene), [`autoloads/MergeManager.gd`](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/MergeManager.gd) (Merge manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game flow"]
  node_main_scene["Main scene<br/>[Main.tscn]"]
  node_main_controller["Main controller<br/>[Main.gd]"]
  node_game_manager["Game manager<br/>[GameManager.gd]"]
  node_merge_manager["Merge manager<br/>[MergeManager.gd]"]
  node_drop_controller["Drop controller<br/>[DropController.gd]"]
  node_danger_zone["Danger zone<br/>[DangerZone.gd]"]
  node_trash_slot["Trash slot<br/>[TrashSlot.gd]"]
  node_wall["Playfield wall<br/>[Wall.gd]"]
end

subgraph group_fruit["Fruit system"]
  node_fruit_scene["Fruit scene<br/>[Fruit.tscn]"]
  node_fruit["Fruit behavior<br/>[Fruit.gd]"]
  node_fruit_tier["Fruit tiers<br/>[FruitTier.gd]"]
  node_fruit_database["Fruit database<br/>[FruitDatabase.gd]"]
  node_fruit_pool["Fruit pool<br/>[FruitPool.gd]"]
  node_fruit_visual_scene["Fruit visual scene<br/>[FruitVisual.tscn]"]
  node_fruit_visual["Fruit visuals<br/>[FruitVisual.gd]"]
  node_fruit_painter["Fruit painter<br/>[FruitPainter.gd]"]
  node_fruit_art["Fruit art<br/>[FruitArt.gd]"]
end

subgraph group_ui["User interface"]
  node_title_scene["Title scene<br/>[TitleScreen.tscn]"]
  node_title_screen["Title screen<br/>[TitleScreen.gd]"]
  node_hud_scene["HUD scene<br/>[HUD.tscn]"]
  node_hud["HUD<br/>[HUD.gd]"]
  node_next_preview["Next fruit preview"]
end

subgraph group_effects["Feedback effects"]
  node_game_fx["Game effects<br/>[GameFX.gd]"]
  node_sfx["Sound effects<br/>[Sfx.gd]"]
  node_floating_text["Floating text<br/>[FloatingText.gd]"]
  node_particle_burst["Particle burst<br/>[ParticleBurst.gd]"]
  node_shockwave["Shockwave<br/>[Shockwave.gd]"]
end

node_player(("Player"))

node_player -.->|"opens"| node_title_screen
node_title_screen -.->|"starts game"| node_main_scene
node_main_scene -.->|"uses"| node_main_controller
node_main_controller -.->|"coordinates"| node_game_manager
node_player -.->|"drops fruit"| node_drop_controller
node_drop_controller -.->|"creates fruit"| node_fruit_pool
node_fruit -.->|"merges"| node_merge_manager
node_merge_manager -.->|"uses tiers"| node_fruit_database
node_fruit -.->|"enters playfield"| node_danger_zone
node_fruit -.->|"can be discarded"| node_trash_slot
node_fruit -.->|"interacts with"| node_wall
node_fruit_scene -.->|"uses behavior"| node_fruit
node_fruit -.->|"uses tiers"| node_fruit_tier
node_fruit -.->|"uses visuals"| node_fruit_visual_scene
node_fruit_visual_scene -.->|"uses behavior"| node_fruit_visual
node_fruit_visual -.->|"draws with"| node_fruit_painter
node_fruit_painter -.->|"uses art"| node_fruit_art
node_main_scene -.->|"shows HUD"| node_hud_scene
node_hud_scene -.->|"uses behavior"| node_hud
node_hud -.->|"shows preview"| node_next_preview
node_merge_manager -.->|"triggers effects"| node_game_fx
node_game_fx -.->|"uses"| node_floating_text
node_game_fx -.->|"uses"| node_particle_burst
node_game_fx -.->|"uses"| node_shockwave
node_game_fx -.->|"plays audio"| node_sfx

click node_main_scene "https://github.com/code-with-l/fruit-saga/blob/main/scenes/Main.tscn"
click node_main_controller "https://github.com/code-with-l/fruit-saga/blob/main/scripts/Main.gd"
click node_game_manager "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/GameManager.gd"
click node_merge_manager "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/MergeManager.gd"
click node_drop_controller "https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/DropController.gd"
click node_danger_zone "https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/DangerZone.gd"
click node_trash_slot "https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/TrashSlot.gd"
click node_wall "https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/Wall.gd"
click node_fruit_scene "https://github.com/code-with-l/fruit-saga/blob/main/scenes/fruit/Fruit.tscn"
click node_fruit "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/Fruit.gd"
click node_fruit_tier "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/FruitTier.gd"
click node_fruit_database "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/FruitDatabase.gd"
click node_fruit_pool "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/FruitPool.gd"
click node_fruit_visual_scene "https://github.com/code-with-l/fruit-saga/blob/main/scenes/fruit/FruitVisual.tscn"
click node_fruit_visual "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/FruitVisual.gd"
click node_fruit_painter "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/FruitPainter.gd"
click node_title_scene "https://github.com/code-with-l/fruit-saga/blob/main/scenes/ui/TitleScreen.tscn"
click node_title_screen "https://github.com/code-with-l/fruit-saga/blob/main/scripts/ui/TitleScreen.gd"
click node_hud_scene "https://github.com/code-with-l/fruit-saga/blob/main/scenes/ui/HUD.tscn"
click node_hud "https://github.com/code-with-l/fruit-saga/blob/main/scripts/ui/HUD.gd"
click node_next_preview "https://github.com/code-with-l/fruit-saga/blob/main/scripts/ui/NextFruitPreview.gd"
click node_fruit_art "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/FruitArt.gd"
click node_game_fx "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/GameFX.gd"
click node_sfx "https://github.com/code-with-l/fruit-saga/blob/main/autoloads/Sfx.gd"
click node_floating_text "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fx/FloatingText.gd"
click node_particle_burst "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fx/ParticleBurst.gd"
click node_shockwave "https://github.com/code-with-l/fruit-saga/blob/main/scripts/fx/Shockwave.gd"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_scene,node_main_controller,node_game_manager,node_merge_manager,node_drop_controller,node_danger_zone,node_trash_slot,node_wall toneBlue
class node_fruit_scene,node_fruit,node_fruit_tier,node_fruit_database,node_fruit_pool,node_fruit_visual_scene,node_fruit_visual,node_fruit_painter,node_fruit_art toneAmber
class node_title_scene,node_title_screen,node_hud_scene,node_hud,node_next_preview toneMint
class node_game_fx,node_sfx,node_floating_text,node_particle_burst,node_shockwave toneRose
class node_player toneIndigo
```

## Components

### Game flow

- [Main scene](https://github.com/code-with-l/fruit-saga/blob/main/scenes/Main.tscn): `scenes/Main.tscn`
- [Main controller](https://github.com/code-with-l/fruit-saga/blob/main/scripts/Main.gd): `scripts/Main.gd`
- [Game manager](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/GameManager.gd): `autoloads/GameManager.gd`
- [Merge manager](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/MergeManager.gd): `autoloads/MergeManager.gd`
- [Drop controller](https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/DropController.gd): `scripts/gameplay/DropController.gd`
- [Danger zone](https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/DangerZone.gd): `scripts/gameplay/DangerZone.gd`
- [Trash slot](https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/TrashSlot.gd): `scripts/gameplay/TrashSlot.gd`
- [Playfield wall](https://github.com/code-with-l/fruit-saga/blob/main/scripts/gameplay/Wall.gd): `scripts/gameplay/Wall.gd`

### Fruit system

- [Fruit scene](https://github.com/code-with-l/fruit-saga/blob/main/scenes/fruit/Fruit.tscn): `scenes/fruit/Fruit.tscn`
- [Fruit behavior](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/Fruit.gd): `scripts/fruit/Fruit.gd`
- [Fruit tiers](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/FruitTier.gd): `scripts/fruit/FruitTier.gd`
- [Fruit database](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/FruitDatabase.gd): `autoloads/FruitDatabase.gd`
- [Fruit pool](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/FruitPool.gd): `autoloads/FruitPool.gd`
- [Fruit visual scene](https://github.com/code-with-l/fruit-saga/blob/main/scenes/fruit/FruitVisual.tscn): `scenes/fruit/FruitVisual.tscn`
- [Fruit visuals](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/FruitVisual.gd): `scripts/fruit/FruitVisual.gd`
- [Fruit painter](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fruit/FruitPainter.gd): `scripts/fruit/FruitPainter.gd`
- [Fruit art](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/FruitArt.gd): `autoloads/FruitArt.gd`

### User interface

- [Title scene](https://github.com/code-with-l/fruit-saga/blob/main/scenes/ui/TitleScreen.tscn): `scenes/ui/TitleScreen.tscn`
- [Title screen](https://github.com/code-with-l/fruit-saga/blob/main/scripts/ui/TitleScreen.gd): `scripts/ui/TitleScreen.gd`
- [HUD scene](https://github.com/code-with-l/fruit-saga/blob/main/scenes/ui/HUD.tscn): `scenes/ui/HUD.tscn`
- [HUD](https://github.com/code-with-l/fruit-saga/blob/main/scripts/ui/HUD.gd): `scripts/ui/HUD.gd`
- [Next fruit preview](https://github.com/code-with-l/fruit-saga/blob/main/scripts/ui/NextFruitPreview.gd): `scripts/ui/NextFruitPreview.gd`

### Feedback effects

- [Game effects](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/GameFX.gd): `autoloads/GameFX.gd`
- [Sound effects](https://github.com/code-with-l/fruit-saga/blob/main/autoloads/Sfx.gd): `autoloads/Sfx.gd`
- [Floating text](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fx/FloatingText.gd): `scripts/fx/FloatingText.gd`
- [Particle burst](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fx/ParticleBurst.gd): `scripts/fx/ParticleBurst.gd`
- [Shockwave](https://github.com/code-with-l/fruit-saga/blob/main/scripts/fx/Shockwave.gd): `scripts/fx/Shockwave.gd`

### Other components

- **Player**

## Connections

- Player → Title screen: opens
- Title screen → Main scene: starts game
- Main scene → Main controller: uses
- Main controller → Game manager: coordinates
- Player → Drop controller: drops fruit
- Drop controller → Fruit pool: creates fruit
- Fruit behavior → Merge manager: merges
- Merge manager → Fruit database: uses tiers
- Fruit behavior → Danger zone: enters playfield
- Fruit behavior → Trash slot: can be discarded
- Fruit behavior → Playfield wall: interacts with
- Fruit scene → Fruit behavior: uses behavior
- Fruit behavior → Fruit tiers: uses tiers
- Fruit behavior → Fruit visual scene: uses visuals
- Fruit visual scene → Fruit visuals: uses behavior
- Fruit visuals → Fruit painter: draws with
- Fruit painter → Fruit art: uses art
- Main scene → HUD scene: shows HUD
- HUD scene → HUD: uses behavior
- HUD → Next fruit preview: shows preview
- Merge manager → Game effects: triggers effects
- Game effects → Floating text: uses
- Game effects → Particle burst: uses
- Game effects → Shockwave: uses
- Game effects → Sound effects: plays audio
