# dlgustn1245/localutopia architecture

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

- Interactive diagram: https://gitdiagram.com/dlgustn1245/localutopia
- Repository: https://github.com/dlgustn1245/localutopia

## Overview

LocalUtopia is a Unity mobile Qix-style game: the player selects a stage, draws a trail to claim territory, and reaches a clear/failure result or the bonus-stage ending and credits. The graph preserves the documented scene flow and separates gameplay, enemy behavior, territory logic, and shared scene services. The README provides the relationship evidence; the source excerpt contains only generated Burst code, so no unsampled C# calls are asserted.

Main entry points: [`Assets/02_Scripts/Qix/QixScene.cs`](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixScene.cs) (Game controller), [`Assets/02_Scripts/Util/SceneLoader.cs`](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneLoader.cs) (Scene transitions), [`Assets/02_Scripts/Util/SceneScripts/TitleScene.cs`](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/TitleScene.cs) (Title and stage selection), [`Assets/02_Scripts/Enemy/QixEnemy.cs`](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/QixEnemy.cs) (Enemy movement and collision)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Scenes and progression"]
  node_title["Title and stage selection<br/>[TitleScene.cs]"]
  node_settings["Settings popup<br/>[GameSetting.cs]"]
  node_loading["Stage introduction<br/>[LoadingScene.cs]"]
  node_ending["Ending dialogue<br/>[EndingScene.cs]"]
  node_credit["Scrolling credits<br/>[CreditScene.cs]"]
end

subgraph group_gameplay["Qix gameplay"]
  node_qixscene["Game controller<br/>[QixScene.cs]"]
  node_playercontrol["Movement and input<br/>[Player.cs]"]
  node_touch["Touch direction button"]
  node_enemybase["Enemy movement and collision<br/>[QixEnemy.cs]"]
  node_glide["Gliding enemies<br/>[GlideEnemy.cs]"]
  node_falling["Falling enemies<br/>[FallingEnemy.cs]"]
  node_trapper["Trapper enemies<br/>[TrapperEnemy.cs]"]
  node_enemydata["Enemy spawn data<br/>[EnemyData.cs]"]
  node_stageassets["Stage configurations"]
end

subgraph group_territory["Board and capture"]
  node_grid["Grid and coordinates<br/>[QixGrid.cs]"]
  node_cellstate["Cell state<br/>[CellState.cs]"]
  node_edgestate["Edge state<br/>[EdgeState.cs]"]
  node_trail["Trail vertices<br/>[QixTrail.cs]"]
  node_capture["Territory capture"]
  node_renderer["Grid renderer<br/>[QixGridRenderer.cs]"]
end

subgraph group_shared["Shared services"]
  node_gamemanager["Stage progress<br/>[GameManager.cs]"]
  node_sound["Audio settings and playback<br/>[SoundManager.cs]"]
  node_loader["Scene transitions<br/>[SceneLoader.cs]"]
  node_fader["Scene fade-in<br/>[SceneFader.cs]"]
  node_decoration["Animated decoration<br/>[Drifter.cs]"]
end

node_player(("Player"))

node_player -->|"selects stage"| node_title
node_player -->|"gives direction"| node_playercontrol
node_player -->|"presses controls"| node_touch
node_title -->|"opens settings"| node_settings
node_title -->|"sets stage"| node_gamemanager
node_title -->|"loads scene"| node_loader
node_loader -->|"loads scene"| node_loading
node_loading -->|"shows stage data"| node_stageassets
node_loading -->|"starts stage BGM"| node_sound
node_loading -->|"loads game"| node_loader
node_loader -->|"loads scene"| node_qixscene
node_qixscene -->|"processes movement"| node_playercontrol
node_qixscene -->|"tracks trail"| node_trail
node_qixscene -->|"captures territory"| node_capture
node_qixscene -->|"checks enemy hits"| node_enemybase
node_qixscene -->|"renders board"| node_renderer
node_qixscene -->|"checks stage progress"| node_gamemanager
node_qixscene -.->|"plays game sounds"| node_sound
node_grid -->|"stores cell states"| node_cellstate
node_grid -->|"stores edge states"| node_edgestate
node_capture -->|"reads and updates"| node_grid
node_capture -->|"claims cells"| node_cellstate
node_capture -->|"checks boundaries"| node_edgestate
node_enemybase -->|"specializes movement"| node_glide
node_enemybase -->|"specializes movement"| node_falling
node_enemybase -->|"specializes movement"| node_trapper
node_enemybase -->|"checks cell edges"| node_grid
node_enemydata -->|"configures stage enemies"| node_stageassets
node_qixscene -->|"spawns configured enemies"| node_enemydata
node_qixscene -->|"returns to title"| node_loader
node_loader -->|"loads bonus ending"| node_ending
node_ending -->|"loads credits"| node_loader
node_loader -->|"loads scene"| node_credit
node_credit -->|"returns to title"| node_loader
node_loader -->|"fades scene entry"| node_fader
node_title -->|"uses decoration"| node_decoration
node_ending -->|"uses decoration"| node_decoration
node_credit -->|"uses decoration"| node_decoration

click node_title "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/TitleScene.cs"
click node_settings "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/GameSetting.cs"
click node_loading "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/LoadingScene.cs"
click node_qixscene "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixScene.cs"
click node_playercontrol "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Player/Player.cs"
click node_touch "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Player/TouchDirectionButton.cs"
click node_enemybase "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/QixEnemy.cs"
click node_glide "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/GlideEnemy.cs"
click node_falling "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/FallingEnemy.cs"
click node_trapper "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/TrapperEnemy.cs"
click node_enemydata "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/EnemyData.cs"
click node_stageassets "https://github.com/dlgustn1245/localutopia/tree/main/Assets/03_Resources/SO"
click node_grid "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixGrid.cs"
click node_cellstate "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/CellState.cs"
click node_edgestate "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/EdgeState.cs"
click node_trail "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixTrail.cs"
click node_capture "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixCaptureService.cs"
click node_renderer "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixGridRenderer.cs"
click node_gamemanager "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/Manager/GameManager.cs"
click node_sound "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/Manager/SoundManager.cs"
click node_loader "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneLoader.cs"
click node_fader "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneFader.cs"
click node_ending "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/EndingScene.cs"
click node_credit "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/CreditScene.cs"
click node_decoration "https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/Drifter.cs"

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_title,node_settings,node_loading,node_ending,node_credit toneBlue
class node_qixscene,node_playercontrol,node_touch,node_enemybase,node_glide,node_falling,node_trapper,node_enemydata,node_stageassets toneAmber
class node_grid,node_cellstate,node_edgestate,node_trail,node_capture,node_renderer toneMint
class node_gamemanager,node_sound,node_loader,node_fader,node_decoration toneRose
class node_player toneIndigo
```

## Components

### Scenes and progression

- [Title and stage selection](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/TitleScene.cs): `Assets/02_Scripts/Util/SceneScripts/TitleScene.cs`
- [Settings popup](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/GameSetting.cs): `Assets/02_Scripts/Util/SceneScripts/GameSetting.cs`
- [Stage introduction](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/LoadingScene.cs): `Assets/02_Scripts/Util/SceneScripts/LoadingScene.cs`
- [Ending dialogue](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/EndingScene.cs): `Assets/02_Scripts/Util/SceneScripts/EndingScene.cs`
- [Scrolling credits](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneScripts/CreditScene.cs): `Assets/02_Scripts/Util/SceneScripts/CreditScene.cs`

### Qix gameplay

- [Game controller](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixScene.cs): `Assets/02_Scripts/Qix/QixScene.cs`
- [Movement and input](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Player/Player.cs): `Assets/02_Scripts/Player/Player.cs`
- [Touch direction button](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Player/TouchDirectionButton.cs): `Assets/02_Scripts/Player/TouchDirectionButton.cs`
- [Enemy movement and collision](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/QixEnemy.cs): `Assets/02_Scripts/Enemy/QixEnemy.cs`
- [Gliding enemies](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/GlideEnemy.cs): `Assets/02_Scripts/Enemy/GlideEnemy.cs`
- [Falling enemies](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/FallingEnemy.cs): `Assets/02_Scripts/Enemy/FallingEnemy.cs`
- [Trapper enemies](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/TrapperEnemy.cs): `Assets/02_Scripts/Enemy/TrapperEnemy.cs`
- [Enemy spawn data](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Enemy/EnemyData.cs): `Assets/02_Scripts/Enemy/EnemyData.cs`
- [Stage configurations](https://github.com/dlgustn1245/localutopia/tree/main/Assets/03_Resources/SO): `Assets/03_Resources/SO`

### Board and capture

- [Grid and coordinates](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixGrid.cs): `Assets/02_Scripts/Qix/QixGrid.cs`
- [Cell state](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/CellState.cs): `Assets/02_Scripts/Qix/CellState.cs`
- [Edge state](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/EdgeState.cs): `Assets/02_Scripts/Qix/EdgeState.cs`
- [Trail vertices](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixTrail.cs): `Assets/02_Scripts/Qix/QixTrail.cs`
- [Territory capture](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixCaptureService.cs): `Assets/02_Scripts/Qix/QixCaptureService.cs`
- [Grid renderer](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Qix/QixGridRenderer.cs): `Assets/02_Scripts/Qix/QixGridRenderer.cs`

### Shared services

- [Stage progress](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/Manager/GameManager.cs): `Assets/02_Scripts/Util/Manager/GameManager.cs`
- [Audio settings and playback](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/Manager/SoundManager.cs): `Assets/02_Scripts/Util/Manager/SoundManager.cs`
- [Scene transitions](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneLoader.cs): `Assets/02_Scripts/Util/SceneLoader.cs`
- [Scene fade-in](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/SceneFader.cs): `Assets/02_Scripts/Util/SceneFader.cs`
- [Animated decoration](https://github.com/dlgustn1245/localutopia/blob/main/Assets/02_Scripts/Util/Drifter.cs): `Assets/02_Scripts/Util/Drifter.cs`

### Other components

- **Player**

## Connections

- Player → Title and stage selection: selects stage (evidence: `README.md`)
- Player → Movement and input: gives direction (evidence: `README.md`)
- Player → Touch direction button: presses controls (evidence: `README.md`)
- Title and stage selection → Settings popup: opens settings (evidence: `README.md`)
- Title and stage selection → Stage progress: sets stage (evidence: `README.md`)
- Title and stage selection → Scene transitions: loads scene (evidence: `README.md`)
- Scene transitions → Stage introduction: loads scene (evidence: `README.md`)
- Stage introduction → Stage configurations: shows stage data (evidence: `README.md`)
- Stage introduction → Audio settings and playback: starts stage BGM (evidence: `README.md`)
- Stage introduction → Scene transitions: loads game (evidence: `README.md`)
- Scene transitions → Game controller: loads scene (evidence: `README.md`)
- Game controller → Movement and input: processes movement (evidence: `README.md`)
- Game controller → Trail vertices: tracks trail (evidence: `README.md`)
- Game controller → Territory capture: captures territory (evidence: `README.md`)
- Game controller → Enemy movement and collision: checks enemy hits (evidence: `README.md`)
- Game controller → Grid renderer: renders board (evidence: `README.md`)
- Game controller → Stage progress: checks stage progress (evidence: `README.md`)
- Game controller → Audio settings and playback: plays game sounds
- Grid and coordinates → Cell state: stores cell states (evidence: `README.md`)
- Grid and coordinates → Edge state: stores edge states (evidence: `README.md`)
- Territory capture → Grid and coordinates: reads and updates (evidence: `README.md`)
- Territory capture → Cell state: claims cells (evidence: `README.md`)
- Territory capture → Edge state: checks boundaries (evidence: `README.md`)
- Enemy movement and collision → Gliding enemies: specializes movement (evidence: `README.md`)
- Enemy movement and collision → Falling enemies: specializes movement (evidence: `README.md`)
- Enemy movement and collision → Trapper enemies: specializes movement (evidence: `README.md`)
- Enemy movement and collision → Grid and coordinates: checks cell edges (evidence: `README.md`)
- Enemy spawn data → Stage configurations: configures stage enemies (evidence: `README.md`)
- Game controller → Enemy spawn data: spawns configured enemies (evidence: `README.md`)
- Game controller → Scene transitions: returns to title (evidence: `README.md`)
- Scene transitions → Ending dialogue: loads bonus ending (evidence: `README.md`)
- Ending dialogue → Scene transitions: loads credits (evidence: `README.md`)
- Scene transitions → Scrolling credits: loads scene (evidence: `README.md`)
- Scrolling credits → Scene transitions: returns to title (evidence: `README.md`)
- Scene transitions → Scene fade-in: fades scene entry (evidence: `README.md`)
- Title and stage selection → Animated decoration: uses decoration (evidence: `README.md`)
- Ending dialogue → Animated decoration: uses decoration (evidence: `README.md`)
- Scrolling credits → Animated decoration: uses decoration (evidence: `README.md`)
