# zoro13252/unity-game-2d architecture

> Architecture diagram of the GitHub repository zoro13252/unity-game-2d, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zoro13252/unity-game-2d
- Repository: https://github.com/zoro13252/unity-game-2d

## Overview

This Unity project appears to be a 2D action-adventure game, with a main menu, playable levels, a player, enemies, and interactive world objects. The tree identifies the likely runtime subsystems, but no source excerpts were provided, so their detailed call flow cannot be verified. The README documents background and enemy-encounter sounds, gate animation, and a Canvas hint; only those relationships are shown, with limited wiring evidence.

Main entry points: [`Assets/Scripts/SoundsScript.cs`](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/SoundsScript.cs) (Game sounds), [`Assets/Prefabs/Canvas.prefab`](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Prefabs/Canvas.prefab) (Canvas hint), [`Assets/Scripts/Enemy Scripts/Enemy.cs`](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Enemy.cs) (Enemy behavior), [`Assets/Scenes/Main Menu.unity`](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scenes/Main%20Menu.unity) (Main menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Gameplay"]
  node_player["Player control<br/>[Player.cs]"]
  node_player_health["Player health<br/>[PlayerHealth.cs]"]
  node_player_abilities["Player abilities<br/>[ShockAttack.cs]"]
  node_teleport["Teleport<br/>[TeleportScript.cs]"]
  node_scene_manager["Scene management<br/>[SceneMangre.cs]"]
end

subgraph group_combat["Combat"]
  node_enemy_ai["Enemy behavior<br/>[Enemy.cs]"]
  node_enemy_search["Player detection<br/>[SearchPlayer.cs]"]
  node_skeleton["Skeleton behavior<br/>[Skeleton.cs]"]
  node_slime["Slime behavior<br/>[SlimeScript.cs]"]
  node_magic["Enemy magic<br/>[Magic.cs]"]
end

subgraph group_world["World interactions"]
  node_chests["Chests<br/>[ChestsScript.cs]"]
  node_bonus["Bonuses<br/>[Bonus.cs]"]
  node_coins["Coins<br/>[Coin.cs]"]
  node_npc["NPC interactions<br/>[NPC.cs]"]
end

subgraph group_presentation["Presentation"]
  node_main_menu["Main menu<br/>[Main Menu.unity]"]
  node_canvas_hint["Canvas hint<br/>[Canvas.prefab]"]
  node_gate_animation["Gate animation"]
  node_audio["Game sounds<br/>[SoundsScript.cs]"]
  node_background_audio["Background audio"]
  node_encounter_audio["Encounter audio"]
end

node_player_actor(("Player"))

node_player_actor -.->|"starts game"| node_main_menu
node_audio -.->|"plays background"| node_background_audio
node_encounter_audio -.->|"uses sounds"| node_audio
node_encounter_audio -.->|"enemy encounter"| node_enemy_ai
node_canvas_hint -.->|"shows hint"| node_player_actor

click node_player "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/Player.cs"
click node_player_health "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/PlayerHealth.cs"
click node_player_abilities "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/ShockAttack.cs"
click node_teleport "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/TeleportScript.cs"
click node_enemy_ai "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Enemy.cs"
click node_enemy_search "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/SearchPlayer.cs"
click node_skeleton "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Skeleton/Skeleton.cs"
click node_slime "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Slime%20Scripts/SlimeScript.cs"
click node_magic "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Magic/Magic.cs"
click node_chests "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/ChestsScript.cs"
click node_bonus "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Bonus%20Scripts/Bonus.cs"
click node_coins "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Coin.cs"
click node_npc "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/NPC%20Scripts/NPC.cs"
click node_scene_manager "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/SceneMangre.cs"
click node_main_menu "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scenes/Main%20Menu.unity"
click node_canvas_hint "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Prefabs/Canvas.prefab"
click node_gate_animation "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Animation/Chest%20Animation/ChestAnimation.anim"
click node_audio "https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/SoundsScript.cs"
click node_background_audio "https://github.com/zoro13252/unity-game-2d/tree/main/Assets/Sounds"

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_player,node_player_health,node_player_abilities,node_teleport,node_scene_manager toneBlue
class node_enemy_ai,node_enemy_search,node_skeleton,node_slime,node_magic toneAmber
class node_chests,node_bonus,node_coins,node_npc toneMint
class node_main_menu,node_canvas_hint,node_gate_animation,node_audio,node_background_audio,node_encounter_audio toneRose
class node_player_actor toneIndigo
```

## Components

### Gameplay

- [Player control](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/Player.cs): `Assets/Scripts/Player Scripts/Player.cs`
- [Player health](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/PlayerHealth.cs): `Assets/Scripts/Player Scripts/PlayerHealth.cs`
- [Player abilities](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/ShockAttack.cs): `Assets/Scripts/Player Scripts/ShockAttack.cs`
- [Teleport](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Player%20Scripts/TeleportScript.cs): `Assets/Scripts/Player Scripts/TeleportScript.cs`
- [Scene management](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/SceneMangre.cs): `Assets/Scripts/SceneMangre.cs`

### Combat

- [Enemy behavior](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Enemy.cs): `Assets/Scripts/Enemy Scripts/Enemy.cs`
- [Player detection](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/SearchPlayer.cs): `Assets/Scripts/Enemy Scripts/SearchPlayer.cs`
- [Skeleton behavior](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Skeleton/Skeleton.cs): `Assets/Scripts/Enemy Scripts/Skeleton/Skeleton.cs`
- [Slime behavior](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Slime%20Scripts/SlimeScript.cs): `Assets/Scripts/Enemy Scripts/Slime Scripts/SlimeScript.cs`
- [Enemy magic](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Enemy%20Scripts/Magic/Magic.cs): `Assets/Scripts/Enemy Scripts/Magic/Magic.cs`

### World interactions

- [Chests](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/ChestsScript.cs): `Assets/Scripts/ChestsScript.cs`
- [Bonuses](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Bonus%20Scripts/Bonus.cs): `Assets/Scripts/Bonus Scripts/Bonus.cs`
- [Coins](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/Coin.cs): `Assets/Scripts/Coin.cs`
- [NPC interactions](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/NPC%20Scripts/NPC.cs): `Assets/Scripts/NPC Scripts/NPC.cs`

### Presentation

- [Main menu](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scenes/Main%20Menu.unity): `Assets/Scenes/Main Menu.unity`
- [Canvas hint](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Prefabs/Canvas.prefab): `Assets/Prefabs/Canvas.prefab`
- [Gate animation](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Animation/Chest%20Animation/ChestAnimation.anim): `Assets/Animation/Chest Animation/ChestAnimation.anim`
- [Game sounds](https://github.com/zoro13252/unity-game-2d/blob/main/Assets/Scripts/SoundsScript.cs): `Assets/Scripts/SoundsScript.cs`
- [Background audio](https://github.com/zoro13252/unity-game-2d/tree/main/Assets/Sounds): `Assets/Sounds`
- **Encounter audio**

### Other components

- **Player**

## Connections

- Player → Main menu: starts game
- Game sounds → Background audio: plays background (evidence: `README.md`)
- Encounter audio → Game sounds: uses sounds
- Encounter audio → Enemy behavior: enemy encounter (evidence: `README.md`)
- Canvas hint → Player: shows hint (evidence: `README.md`)
