# bigshot525/dwarf-mountain architecture

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

- Interactive diagram: https://gitdiagram.com/bigshot525/dwarf-mountain
- Repository: https://github.com/bigshot525/dwarf-mountain

## Overview

Dwarf-Mountain is a Java desktop 2D survival game. The player uses keyboard and mouse input to move, attack and break tiles, collect dropped items, and access inventory and crafting; save screens support creating, loading, overwriting, and deleting named saves. The sampled code establishes the input, player, tile, item, and save interactions shown here. The README gives no further feature detail, and GamePanel, menu, and UI implementation was not sampled, so uncertain runtime wiring is omitted.

Main entry points: [`src/Main/KeyHandler.java`](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/KeyHandler.java) (Input handler), [`src/Main/SaveManager.java`](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/SaveManager.java) (Save manager), [`src/entity/Player.java`](https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Player.java) (Player character), [`src/tile/TileManager.java`](https://github.com/bigshot525/dwarf-mountain/blob/main/src/tile/TileManager.java) (Tile manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_main["Application entry<br/>[Main.java]"]
  node_panel["Game panel<br/>[GamePanel.java]"]
  node_input["Input handler<br/>[KeyHandler.java]"]
  node_menu["Main menu<br/>[MainMenu.java]"]
  node_ui["Game UI<br/>[UI.java]"]
  node_state["Game state<br/>[GameState.java]"]
end

subgraph group_world["World and items"]
  node_collision["Collision checker"]
  node_player["Player character<br/>[Player.java]"]
  node_entity["Entity model<br/>[Entity.java]"]
  node_items["Items and drops<br/>[Item.java]"]
  node_objects["World objects"]
  node_tiles["Tile manager<br/>[TileManager.java]"]
  node_tile["Tile properties<br/>[Tile.java]"]
  node_maps["World map data"]
end

subgraph group_saves["Save management"]
  node_savescreen["Save screen<br/>[SaveScreen.java]"]
  node_savemanager["Save manager<br/>[SaveManager.java]"]
  node_savedata[("Save files")]
end

node_user(("Player"))

node_user -->|"provides input"| node_input
node_main -->|"creates"| node_panel
node_input -->|"routes input"| node_savescreen
node_input -->|"dispatches clicks"| node_menu
node_input -->|"dispatches clicks"| node_ui
node_player -->|"checks tiles"| node_collision
node_player -->|"breaks tiles"| node_panel
node_player -->|"collects drops"| node_items
node_items -->|"specializes as"| node_objects
node_tiles -->|"loads map"| node_maps
node_tiles -->|"uses tile data"| node_tile
node_savescreen -->|"requests save actions"| node_savemanager
node_savemanager -->|"reads and writes"| node_savedata
node_savemanager -->|"loads player state"| node_player
node_savemanager -->|"loads map state"| node_tiles

click node_main "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/Main.java"
click node_panel "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/GamePanel.java"
click node_input "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/KeyHandler.java"
click node_menu "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/MainMenu.java"
click node_ui "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/UI.java"
click node_state "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/GameState.java"
click node_collision "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/CollisionChecker.java"
click node_player "https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Player.java"
click node_entity "https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Entity.java"
click node_items "https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Item.java"
click node_objects "https://github.com/bigshot525/dwarf-mountain/tree/main/src/entity/object"
click node_tiles "https://github.com/bigshot525/dwarf-mountain/blob/main/src/tile/TileManager.java"
click node_tile "https://github.com/bigshot525/dwarf-mountain/blob/main/src/tile/Tile.java"
click node_maps "https://github.com/bigshot525/dwarf-mountain/tree/main/src/res/maps"
click node_savescreen "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/SaveScreen.java"
click node_savemanager "https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/SaveManager.java"
click node_savedata "https://github.com/bigshot525/dwarf-mountain/tree/main/saves"

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,node_panel,node_input,node_menu,node_ui,node_state toneBlue
class node_collision,node_player,node_entity,node_items,node_objects,node_tiles,node_tile,node_maps toneAmber
class node_savescreen,node_savemanager,node_savedata toneMint
class node_user toneIndigo
```

## Components

### Game runtime

- [Application entry](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/Main.java): `src/Main/Main.java`
- [Game panel](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/GamePanel.java): `src/Main/GamePanel.java`
- [Input handler](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/KeyHandler.java): `src/Main/KeyHandler.java`
- [Main menu](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/MainMenu.java): `src/Main/MainMenu.java`
- [Game UI](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/UI.java): `src/Main/UI.java`
- [Game state](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/GameState.java): `src/Main/GameState.java`

### World and items

- [Collision checker](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/CollisionChecker.java): `src/Main/CollisionChecker.java`
- [Player character](https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Player.java): `src/entity/Player.java`
- [Entity model](https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Entity.java): `src/entity/Entity.java`
- [Items and drops](https://github.com/bigshot525/dwarf-mountain/blob/main/src/entity/Item.java): `src/entity/Item.java`
- [World objects](https://github.com/bigshot525/dwarf-mountain/tree/main/src/entity/object): `src/entity/object`
- [Tile manager](https://github.com/bigshot525/dwarf-mountain/blob/main/src/tile/TileManager.java): `src/tile/TileManager.java`
- [Tile properties](https://github.com/bigshot525/dwarf-mountain/blob/main/src/tile/Tile.java): `src/tile/Tile.java`
- [World map data](https://github.com/bigshot525/dwarf-mountain/tree/main/src/res/maps): `src/res/maps`

### Save management

- [Save screen](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/SaveScreen.java): `src/Main/SaveScreen.java`
- [Save manager](https://github.com/bigshot525/dwarf-mountain/blob/main/src/Main/SaveManager.java): `src/Main/SaveManager.java`
- [Save files](https://github.com/bigshot525/dwarf-mountain/tree/main/saves): `saves`

### Other components

- **Player**

## Connections

- Player → Input handler: provides input
- Application entry → Game panel: creates
- Input handler → Save screen: routes input
- Input handler → Main menu: dispatches clicks
- Input handler → Game UI: dispatches clicks
- Player character → Collision checker: checks tiles
- Player character → Game panel: breaks tiles
- Player character → Items and drops: collects drops
- Items and drops → World objects: specializes as
- Tile manager → World map data: loads map
- Tile manager → Tile properties: uses tile data
- Save screen → Save manager: requests save actions
- Save manager → Save files: reads and writes
- Save manager → Player character: loads player state
- Save manager → Tile manager: loads map state
