# markkyrollos/new_game architecture

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

- Interactive diagram: https://gitdiagram.com/markkyrollos/new_game
- Repository: https://github.com/markkyrollos/new_game

## Overview

NEW_GAME (GOTY) is a Qt-based 2D top-down dungeon crawler. The documented flow is launch into a tile-map arena, control a player to traverse it and fight enemies, then face a final boss; combat includes shooting, hazards, collectibles, and timed doors. The sampled entry point reads Board.txt, constructs game entities, and places map tiles and characters in a graphics scene. README-listed gameplay subsystems whose implementation wiring was not sampled are represented conservatively; no unsupported interactions are inferred.

Main entry points: [`GOTY(18-4-22)/main.cpp`](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp) (Game entry), [`GOTY(18-4-22)/enemy.cpp`](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/enemy.cpp) (Enemy behavior), [`GOTY(18-4-22)/player.cpp`](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/player.cpp) (Player logic), [`GOTY(18-4-22)/minor.cpp`](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/minor.cpp) (Minor enemy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Game setup"]
  node_entry["Game entry<br/>[main.cpp]"]
end

subgraph group_world["Dungeon world"]
  node_board_file["Board.txt"]
  node_map["Tile map<br/>[main.cpp]"]
  node_entity["Shared entities<br/>[entity.cpp]"]
  node_coin["Coin pickup<br/>[coin.cpp]"]
  node_door["Timed doors<br/>[doortimer.cpp]"]
end

subgraph group_combat["Combat and AI"]
  node_character["Character base<br/>[character.cpp]"]
  node_player["Player logic<br/>[player.cpp]"]
  node_enemy["Enemy behavior<br/>[enemy.cpp]"]
  node_minor["Minor enemy<br/>[minor.cpp]"]
  node_major["Major enemy<br/>[major.cpp]"]
  node_boss["Final boss<br/>[boss.cpp]"]
  node_astar["A* pathfinding<br/>[a_star.cpp]"]
  node_projectile["Projectiles<br/>[projectile.cpp]"]
end

subgraph group_presentation["Interface and media"]
  node_scene["Graphics scene<br/>[main.cpp]"]
  node_menu["Main menu<br/>[main_menu.cpp]"]
  node_window["Game window<br/>[mainwindow.cpp]"]
  node_audio["Music and SFX"]
end

node_player_actor(("Player"))

node_player_actor -->|"controls"| node_player
node_entry -->|"reads map"| node_board_file
node_entry -->|"initializes"| node_map
node_entry -->|"creates"| node_player
node_entry -->|"creates"| node_minor
node_entry -->|"creates"| node_major
node_entry -->|"creates"| node_boss
node_entry -->|"adds tiles and actors"| node_scene
node_minor -->|"inherits"| node_enemy
node_major -->|"inherits"| node_enemy
node_boss -->|"inherits"| node_enemy
node_enemy -.->|"uses paths"| node_astar
node_player -->|"fires"| node_projectile
node_entry -.->|"launch flow"| node_menu
node_menu -.->|"starts game"| node_window

click node_entry "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp"
click node_map "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp"
click node_scene "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp"
click node_character "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/character.cpp"
click node_player "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/player.cpp"
click node_enemy "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/enemy.cpp"
click node_minor "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/minor.cpp"
click node_major "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/major.cpp"
click node_boss "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/boss.cpp"
click node_astar "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/a_star.cpp"
click node_projectile "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/projectile.cpp"
click node_entity "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/entity.cpp"
click node_coin "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/coin.cpp"
click node_door "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/doortimer.cpp"
click node_menu "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main_menu.cpp"
click node_window "https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/mainwindow.cpp"
click node_audio "https://github.com/markkyrollos/new_game/tree/main/GOTY(18-4-22)"

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_entry toneBlue
class node_board_file,node_map,node_entity,node_coin,node_door toneAmber
class node_character,node_player,node_enemy,node_minor,node_major,node_boss,node_astar,node_projectile toneMint
class node_scene,node_menu,node_window,node_audio toneRose
class node_player_actor toneIndigo
```

## Components

### Game setup

- [Game entry](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp): `GOTY(18-4-22)/main.cpp`

### Dungeon world

- **Board.txt**
- [Tile map](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp): `GOTY(18-4-22)/main.cpp`
- [Shared entities](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/entity.cpp): `GOTY(18-4-22)/entity.cpp`
- [Coin pickup](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/coin.cpp): `GOTY(18-4-22)/coin.cpp`
- [Timed doors](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/doortimer.cpp): `GOTY(18-4-22)/doortimer.cpp`

### Combat and AI

- [Character base](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/character.cpp): `GOTY(18-4-22)/character.cpp`
- [Player logic](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/player.cpp): `GOTY(18-4-22)/player.cpp`
- [Enemy behavior](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/enemy.cpp): `GOTY(18-4-22)/enemy.cpp`
- [Minor enemy](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/minor.cpp): `GOTY(18-4-22)/minor.cpp`
- [Major enemy](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/major.cpp): `GOTY(18-4-22)/major.cpp`
- [Final boss](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/boss.cpp): `GOTY(18-4-22)/boss.cpp`
- [A* pathfinding](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/a_star.cpp): `GOTY(18-4-22)/a_star.cpp`
- [Projectiles](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/projectile.cpp): `GOTY(18-4-22)/projectile.cpp`

### Interface and media

- [Graphics scene](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main.cpp): `GOTY(18-4-22)/main.cpp`
- [Main menu](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/main_menu.cpp): `GOTY(18-4-22)/main_menu.cpp`
- [Game window](https://github.com/markkyrollos/new_game/blob/main/GOTY(18-4-22)/mainwindow.cpp): `GOTY(18-4-22)/mainwindow.cpp`
- [Music and SFX](https://github.com/markkyrollos/new_game/tree/main/GOTY(18-4-22)): `GOTY(18-4-22)`

### Other components

- **Player**

## Connections

- Player → Player logic: controls
- Game entry → Board.txt: reads map
- Game entry → Tile map: initializes
- Game entry → Player logic: creates
- Game entry → Minor enemy: creates
- Game entry → Major enemy: creates
- Game entry → Final boss: creates
- Game entry → Graphics scene: adds tiles and actors
- Minor enemy → Enemy behavior: inherits
- Major enemy → Enemy behavior: inherits
- Final boss → Enemy behavior: inherits
- Enemy behavior → A* pathfinding: uses paths
- Player logic → Projectiles: fires
- Game entry → Main menu: launch flow
- Main menu → Game window: starts game
