# aaaarrrrrrttttiiiiixxxx/game architecture

> Architecture diagram of the GitHub repository aaaarrrrrrttttiiiiixxxx/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/aaaarrrrrrttttiiiiixxxx/game
- Repository: https://github.com/aaaarrrrrrttttiiiiixxxx/game

## Overview

This is a desktop action game: the player starts a run from the Qt menu, survives real-time combat, gains levels, chooses upgrades or abilities, and returns a level result when defeated. The sampled code establishes the menu-to-game and game-loop orchestration, plus player combat, damage events, and the fire-roller ability. The README is empty and several gameplay modules are unsampled, so uncertain subsystem wiring is omitted.

Main entry points: [`game.py`](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/game.py) (Game loop), [`units/player.py`](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/player.py) (Player), [`main_menu/main_window.py`](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/main_window.py) (Main window), [`unit_layer.py`](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/unit_layer.py) (Unit layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_menu["Desktop menu"]
  node_entry["Application entry<br/>[main.py]"]
  node_window["Main window<br/>[main_window.py]"]
  node_widgets["Menu widgets"]
  node_best["Best result"]
end

subgraph group_game["Run orchestration"]
  node_game["Game loop<br/>[game.py]"]
  node_result["Run result<br/>[main_window.py]"]
end

subgraph group_world["World and combat"]
  node_player["Player<br/>[player.py]"]
  node_layer["Unit layer<br/>[unit_layer.py]"]
  node_generator["Enemy generator<br/>[unit_generator.py]"]
  node_enemies["Enemies<br/>[enemies.py]"]
  node_units["Unit behavior<br/>[base_units.py]"]
  node_events["Combat events<br/>[EventAggregator.py]"]
  node_projectile["Moving units<br/>[moving_to_point.py]"]
end

subgraph group_progression["Abilities and progression"]
  node_ability_screen["Upgrade choice"]
  node_upgrades["Upgrade factory<br/>[upgrades.py]"]
  node_abilities["Ability system<br/>[base_abilities.py]"]
  node_fire_roller["Fire roller"]
end

subgraph group_support["Rendering and state"]
  node_clock["Frame clock<br/>[clock.py]"]
  node_background["Background<br/>[background.py]"]
  node_camera["Camera<br/>[camera.py]"]
  node_images["Unit image stores<br/>[image_stores.py]"]
  node_image_provider["Image provider<br/>[image_provider.py]"]
end

node_user(("Player"))

node_user -->|"starts run"| node_window
node_entry -->|"opens"| node_window
node_window -->|"builds UI"| node_widgets
node_window -->|"runs game"| node_game
node_window -->|"reads and updates"| node_best
node_game -->|"ticks"| node_clock
node_game -->|"draws"| node_background
node_game -->|"creates"| node_camera
node_game -->|"creates and updates"| node_layer
node_game -->|"steps"| node_generator
node_game -->|"requests choices"| node_upgrades
node_game -->|"opens choice"| node_ability_screen
node_game -->|"reads and controls"| node_player
node_game -->|"returns level"| node_result
node_layer -->|"manages"| node_player
node_generator -->|"adds enemies"| node_layer
node_player -->|"queries nearby mobs"| node_layer
node_player -->|"dispatches damage"| node_events
node_units -->|"subscribes to damage"| node_events
node_units -->|"loads frames"| node_images
node_units -->|"maps positions"| node_camera
node_upgrades -->|"checks eligibility"| node_player
node_game -->|"applies selection"| node_ability_screen
node_player -->|"uses and advances"| node_abilities
node_fire_roller -->|"creates moving unit"| node_projectile
node_fire_roller -->|"adds projectile"| node_layer
node_fire_roller -->|"dispatches damage"| node_events
node_fire_roller -->|"loads icon"| node_image_provider
node_upgrades -->|"loads icons"| node_image_provider

click node_player "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/player.py"
click node_entry "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main.py"
click node_window "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/main_window.py"
click node_widgets "https://github.com/aaaarrrrrrttttiiiiixxxx/game/tree/master/main_menu/widgets"
click node_best "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/best_result_repository.py"
click node_game "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/game.py"
click node_clock "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/clock.py"
click node_background "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/background.py"
click node_camera "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/camera.py"
click node_layer "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/unit_layer.py"
click node_generator "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/unit_generator.py"
click node_enemies "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/enemies.py"
click node_units "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/base_units.py"
click node_images "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/image_stores.py"
click node_events "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/EventAggregator.py"
click node_ability_screen "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/ability_choose_screen.py"
click node_upgrades "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/upgrades_and_abilities/upgrades.py"
click node_abilities "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/upgrades_and_abilities/base_abilities.py"
click node_fire_roller "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/upgrades_and_abilities/fire_roller_ability.py"
click node_projectile "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/moving_to_point.py"
click node_image_provider "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/image_provider.py"
click node_result "https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/main_window.py"

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,node_window,node_widgets,node_best toneBlue
class node_game,node_result toneAmber
class node_player,node_layer,node_generator,node_enemies,node_units,node_events,node_projectile toneMint
class node_ability_screen,node_upgrades,node_abilities,node_fire_roller toneRose
class node_clock,node_background,node_camera,node_images,node_image_provider,node_user toneIndigo
```

## Components

### Desktop menu

- [Application entry](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main.py): `main.py`
- [Main window](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/main_window.py): `main_menu/main_window.py`
- [Menu widgets](https://github.com/aaaarrrrrrttttiiiiixxxx/game/tree/master/main_menu/widgets): `main_menu/widgets`
- [Best result](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/best_result_repository.py): `main_menu/best_result_repository.py`

### Run orchestration

- [Game loop](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/game.py): `game.py`
- [Run result](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/main_menu/main_window.py): `main_menu/main_window.py`

### World and combat

- [Player](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/player.py): `units/player.py`
- [Unit layer](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/unit_layer.py): `unit_layer.py`
- [Enemy generator](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/unit_generator.py): `unit_generator.py`
- [Enemies](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/enemies.py): `units/enemies.py`
- [Unit behavior](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/base_units.py): `units/base_units.py`
- [Combat events](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/EventAggregator.py): `EventAggregator.py`
- [Moving units](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/moving_to_point.py): `units/moving_to_point.py`

### Abilities and progression

- [Upgrade choice](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/ability_choose_screen.py): `ability_choose_screen.py`
- [Upgrade factory](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/upgrades_and_abilities/upgrades.py): `upgrades_and_abilities/upgrades.py`
- [Ability system](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/upgrades_and_abilities/base_abilities.py): `upgrades_and_abilities/base_abilities.py`
- [Fire roller](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/upgrades_and_abilities/fire_roller_ability.py): `upgrades_and_abilities/fire_roller_ability.py`

### Rendering and state

- [Frame clock](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/clock.py): `clock.py`
- [Background](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/background.py): `background.py`
- [Camera](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/camera.py): `camera.py`
- [Unit image stores](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/units/image_stores.py): `units/image_stores.py`
- [Image provider](https://github.com/aaaarrrrrrttttiiiiixxxx/game/blob/master/image_provider.py): `image_provider.py`

### Other components

- **Player**

## Connections

- Player → Main window: starts run
- Application entry → Main window: opens
- Main window → Menu widgets: builds UI
- Main window → Game loop: runs game
- Main window → Best result: reads and updates
- Game loop → Frame clock: ticks
- Game loop → Background: draws
- Game loop → Camera: creates
- Game loop → Unit layer: creates and updates
- Game loop → Enemy generator: steps
- Game loop → Upgrade factory: requests choices
- Game loop → Upgrade choice: opens choice
- Game loop → Player: reads and controls
- Game loop → Run result: returns level
- Unit layer → Player: manages
- Enemy generator → Unit layer: adds enemies
- Player → Unit layer: queries nearby mobs
- Player → Combat events: dispatches damage
- Unit behavior → Combat events: subscribes to damage
- Unit behavior → Unit image stores: loads frames
- Unit behavior → Camera: maps positions
- Upgrade factory → Player: checks eligibility
- Game loop → Upgrade choice: applies selection
- Player → Ability system: uses and advances
- Fire roller → Moving units: creates moving unit
- Fire roller → Unit layer: adds projectile
- Fire roller → Combat events: dispatches damage
- Fire roller → Image provider: loads icon
- Upgrade factory → Image provider: loads icons
