# agheadley32/dungeon-game architecture

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

- Interactive diagram: https://gitdiagram.com/agheadley32/dungeon-game
- Repository: https://github.com/agheadley32/dungeon-game

## Overview

Dungeon Escape is a seed-driven Java dungeon adventure. The player starts a game, selects a hero, explores generated rooms to collect shards and assemble a key, evades a zombie, and answers a final riddle. Main.java owns the game flow and rendering calls; World.java generates the tile map, while the tile engine represents and draws it. The README documents gameplay stages not fully visible in the sampled excerpts, so those links are cited to the README; unsampled enemy and selection behavior is not independently verified.

Main entry points: [`src/core/Main.java`](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java) (Title and intro), [`src/tileengine/TETile.java`](https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/TETile.java) (Tile model), [`src/core/World.java`](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/World.java) (World generation), [`src/tileengine/Tileset.java`](https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/Tileset.java) (Tile definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game flow"]
  node_menu["Title and intro<br/>[Main.java]"]
  node_seed["Seed input<br/>[Main.java]"]
  node_hero["Hero selection<br/>[Main.java]"]
  node_exploration["Dungeon exploration<br/>[Main.java]"]
  node_shards["Shard collection<br/>[Main.java]"]
  node_key["Key assembly<br/>[Main.java]"]
  node_zombie["Zombie chase<br/>[Main.java]"]
  node_riddle["Final riddle<br/>[Main.java]"]
end

subgraph group_world["Dungeon world"]
  node_worldgen["World generation<br/>[World.java]"]
  node_random["Random utilities<br/>[RandomUtils.java]"]
end

subgraph group_rendering["Tile rendering"]
  node_tiledefs["Tile definitions<br/>[Tileset.java]"]
  node_tilemodel["Tile model<br/>[TETile.java]"]
  node_renderer["Frame renderer<br/>[TERenderer.java]"]
end

subgraph group_persistence["Saved state"]
  node_savefile[("Save file<br/>[save.txt]")]
end

node_player(("Player"))

node_player -->|"starts game"| node_menu
node_menu -->|"begins new game"| node_seed
node_seed -->|"continues to"| node_hero
node_hero -->|"enters dungeon"| node_exploration
node_exploration -->|"collects gems"| node_shards
node_shards -->|"assembles key"| node_key
node_key -->|"evades enemy"| node_zombie
node_zombie -->|"reaches challenge"| node_riddle
node_seed -->|"generates map"| node_worldgen
node_worldgen -->|"uses tiles"| node_tiledefs
node_menu -->|"renders frame"| node_renderer
node_renderer -->|"draws tiles"| node_tilemodel
node_tiledefs -->|"defines tiles"| node_tilemodel
node_tilemodel -->|"varies color"| node_random
node_menu -->|"loads and saves"| node_savefile

click node_menu "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_seed "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_hero "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_exploration "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_shards "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_key "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_zombie "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_riddle "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java"
click node_worldgen "https://github.com/agheadley32/dungeon-game/blob/develop/src/core/World.java"
click node_tiledefs "https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/Tileset.java"
click node_tilemodel "https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/TETile.java"
click node_renderer "https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/TERenderer.java"
click node_random "https://github.com/agheadley32/dungeon-game/blob/develop/src/utils/RandomUtils.java"
click node_savefile "https://github.com/agheadley32/dungeon-game/blob/develop/save.txt"

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_menu,node_seed,node_hero,node_exploration,node_shards,node_key,node_zombie,node_riddle toneBlue
class node_worldgen,node_random toneAmber
class node_tiledefs,node_tilemodel,node_renderer toneMint
class node_savefile toneRose
class node_player toneIndigo
```

## Components

### Game flow

- [Title and intro](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Seed input](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Hero selection](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Dungeon exploration](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Shard collection](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Key assembly](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Zombie chase](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`
- [Final riddle](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/Main.java): `src/core/Main.java`

### Dungeon world

- [World generation](https://github.com/agheadley32/dungeon-game/blob/develop/src/core/World.java): `src/core/World.java`
- [Random utilities](https://github.com/agheadley32/dungeon-game/blob/develop/src/utils/RandomUtils.java): `src/utils/RandomUtils.java`

### Tile rendering

- [Tile definitions](https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/Tileset.java): `src/tileengine/Tileset.java`
- [Tile model](https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/TETile.java): `src/tileengine/TETile.java`
- [Frame renderer](https://github.com/agheadley32/dungeon-game/blob/develop/src/tileengine/TERenderer.java): `src/tileengine/TERenderer.java`

### Saved state

- [Save file](https://github.com/agheadley32/dungeon-game/blob/develop/save.txt): `save.txt`

### Other components

- **Player**

## Connections

- Player → Title and intro: starts game (evidence: `README.md`)
- Title and intro → Seed input: begins new game (evidence: `README.md`)
- Seed input → Hero selection: continues to (evidence: `README.md`)
- Hero selection → Dungeon exploration: enters dungeon (evidence: `README.md`)
- Dungeon exploration → Shard collection: collects gems (evidence: `README.md`)
- Shard collection → Key assembly: assembles key (evidence: `README.md`)
- Key assembly → Zombie chase: evades enemy (evidence: `README.md`)
- Zombie chase → Final riddle: reaches challenge (evidence: `README.md`)
- Seed input → World generation: generates map (evidence: `src/core/Main.java`)
- World generation → Tile definitions: uses tiles (evidence: `src/core/World.java`)
- Title and intro → Frame renderer: renders frame (evidence: `src/core/Main.java`)
- Frame renderer → Tile model: draws tiles (evidence: `src/tileengine/TERenderer.java`)
- Tile definitions → Tile model: defines tiles (evidence: `src/tileengine/Tileset.java`)
- Tile model → Random utilities: varies color (evidence: `src/tileengine/TETile.java`)
- Title and intro → Save file: loads and saves (evidence: `src/core/Main.java`)
