# rael0515/pygameproject_text architecture

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

- Interactive diagram: https://gitdiagram.com/rael0515/pygameproject_text
- Repository: https://github.com/rael0515/pygameproject_text

## Overview

This is a console-based Python dungeon game. The player chooses a mode, receives an introduction, and enters a sequence of floors containing combat, camps, shops, and bosses; a score is calculated at the end. Character progression and inventory support those stages. The README only identifies the project as a Python game, so details of the workflow come from the sampled source and SOURCE INDEX. Infinity mode is present but currently returns immediately as unfinished.

Main entry points: [`MoveMode.py`](https://github.com/rael0515/pygameproject_text/blob/main/MoveMode.py) (Mode runner), [`Encounter.py`](https://github.com/rael0515/pygameproject_text/blob/main/Encounter.py) (Encounters), [`main.py`](https://github.com/rael0515/pygameproject_text/blob/main/main.py) (Game entry), [`GetValue.py`](https://github.com/rael0515/pygameproject_text/blob/main/GetValue.py) (Input validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game_flow["Game flow"]
  node_entry["Game entry<br/>[main.py]"]
  node_mode_choice["Mode selection<br/>[ChoseMode.py]"]
  node_introduction["Introduction<br/>[Intro.py]"]
  node_name_setup["Name setup<br/>[NameSet.py]"]
  node_mode_runner["Mode runner<br/>[MoveMode.py]"]
  node_input_validation["Input validation<br/>[GetValue.py]"]
end

subgraph group_world_combat["World and combat"]
  node_map_generation["Floor events<br/>[MakeMap.py]"]
  node_encounters["Encounters<br/>[Encounter.py]"]
  node_combat_turns["Combat turns<br/>[Move.py]"]
  node_enemies["Enemy types<br/>[Enemy.py]"]
end

subgraph group_player_items["Player and items"]
  node_character["Character state<br/>[CharacterInfo.py]"]
  node_shop["Shop<br/>[Shop.py]"]
  node_item_actions["Item actions<br/>[Item.py]"]
  node_item_catalog["Item catalog<br/>[ItemList.py]"]
end

subgraph group_progression["Progression"]
  node_final_score["Final score<br/>[FinalScore.py]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_entry
node_entry -->|"chooses mode"| node_mode_choice
node_entry -->|"starts intro"| node_introduction
node_entry -->|"runs mode"| node_mode_runner
node_mode_choice -->|"validates input"| node_input_validation
node_introduction -->|"sets name"| node_name_setup
node_name_setup -->|"creates character"| node_character
node_mode_runner -->|"generates floors"| node_map_generation
node_mode_runner -->|"starts encounters"| node_encounters
node_mode_runner -->|"validates input"| node_input_validation
node_mode_runner -->|"calculates score"| node_final_score
node_map_generation -->|"starts events"| node_encounters
node_encounters -->|"creates enemies"| node_enemies
node_encounters -->|"runs combat"| node_combat_turns
node_encounters -->|"opens shop"| node_shop
node_combat_turns -->|"attacks enemy"| node_enemies
node_combat_turns -->|"validates moves"| node_input_validation
node_shop -->|"buys items"| node_item_actions
node_shop -->|"validates choices"| node_input_validation
node_item_actions -->|"loads catalog"| node_item_catalog
node_character -->|"loads item lists"| node_item_actions
node_final_score -->|"reads player state"| node_character

click node_entry "https://github.com/rael0515/pygameproject_text/blob/main/main.py"
click node_mode_choice "https://github.com/rael0515/pygameproject_text/blob/main/ChoseMode.py"
click node_introduction "https://github.com/rael0515/pygameproject_text/blob/main/Intro.py"
click node_name_setup "https://github.com/rael0515/pygameproject_text/blob/main/NameSet.py"
click node_mode_runner "https://github.com/rael0515/pygameproject_text/blob/main/MoveMode.py"
click node_map_generation "https://github.com/rael0515/pygameproject_text/blob/main/MakeMap.py"
click node_encounters "https://github.com/rael0515/pygameproject_text/blob/main/Encounter.py"
click node_combat_turns "https://github.com/rael0515/pygameproject_text/blob/main/Move.py"
click node_enemies "https://github.com/rael0515/pygameproject_text/blob/main/Enemy.py"
click node_character "https://github.com/rael0515/pygameproject_text/blob/main/CharacterInfo.py"
click node_shop "https://github.com/rael0515/pygameproject_text/blob/main/Shop.py"
click node_item_actions "https://github.com/rael0515/pygameproject_text/blob/main/Item.py"
click node_item_catalog "https://github.com/rael0515/pygameproject_text/blob/main/ItemList.py"
click node_input_validation "https://github.com/rael0515/pygameproject_text/blob/main/GetValue.py"
click node_final_score "https://github.com/rael0515/pygameproject_text/blob/main/FinalScore.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_mode_choice,node_introduction,node_name_setup,node_mode_runner,node_input_validation toneBlue
class node_map_generation,node_encounters,node_combat_turns,node_enemies toneAmber
class node_character,node_shop,node_item_actions,node_item_catalog toneMint
class node_final_score toneRose
class node_player toneIndigo
```

## Components

### Game flow

- [Game entry](https://github.com/rael0515/pygameproject_text/blob/main/main.py): `main.py`
- [Mode selection](https://github.com/rael0515/pygameproject_text/blob/main/ChoseMode.py): `ChoseMode.py`
- [Introduction](https://github.com/rael0515/pygameproject_text/blob/main/Intro.py): `Intro.py`
- [Name setup](https://github.com/rael0515/pygameproject_text/blob/main/NameSet.py): `NameSet.py`
- [Mode runner](https://github.com/rael0515/pygameproject_text/blob/main/MoveMode.py): `MoveMode.py`
- [Input validation](https://github.com/rael0515/pygameproject_text/blob/main/GetValue.py): `GetValue.py`

### World and combat

- [Floor events](https://github.com/rael0515/pygameproject_text/blob/main/MakeMap.py): `MakeMap.py`
- [Encounters](https://github.com/rael0515/pygameproject_text/blob/main/Encounter.py): `Encounter.py`
- [Combat turns](https://github.com/rael0515/pygameproject_text/blob/main/Move.py): `Move.py`
- [Enemy types](https://github.com/rael0515/pygameproject_text/blob/main/Enemy.py): `Enemy.py`

### Player and items

- [Character state](https://github.com/rael0515/pygameproject_text/blob/main/CharacterInfo.py): `CharacterInfo.py`
- [Shop](https://github.com/rael0515/pygameproject_text/blob/main/Shop.py): `Shop.py`
- [Item actions](https://github.com/rael0515/pygameproject_text/blob/main/Item.py): `Item.py`
- [Item catalog](https://github.com/rael0515/pygameproject_text/blob/main/ItemList.py): `ItemList.py`

### Progression

- [Final score](https://github.com/rael0515/pygameproject_text/blob/main/FinalScore.py): `FinalScore.py`

### Other components

- **Player**

## Connections

- Player → Game entry: starts game (evidence: `main.py`)
- Game entry → Mode selection: chooses mode (evidence: `main.py`)
- Game entry → Introduction: starts intro (evidence: `main.py`)
- Game entry → Mode runner: runs mode (evidence: `main.py`)
- Mode selection → Input validation: validates input (evidence: `ChoseMode.py`)
- Introduction → Name setup: sets name (evidence: `Intro.py`)
- Name setup → Character state: creates character (evidence: `NameSet.py`)
- Mode runner → Floor events: generates floors (evidence: `MoveMode.py`)
- Mode runner → Encounters: starts encounters (evidence: `MoveMode.py`)
- Mode runner → Input validation: validates input (evidence: `MoveMode.py`)
- Mode runner → Final score: calculates score (evidence: `MoveMode.py`)
- Floor events → Encounters: starts events (evidence: `MakeMap.py`)
- Encounters → Enemy types: creates enemies (evidence: `Encounter.py`)
- Encounters → Combat turns: runs combat (evidence: `Encounter.py`)
- Encounters → Shop: opens shop (evidence: `Encounter.py`)
- Combat turns → Enemy types: attacks enemy (evidence: `Move.py`)
- Combat turns → Input validation: validates moves (evidence: `Move.py`)
- Shop → Item actions: buys items (evidence: `Shop.py`)
- Shop → Input validation: validates choices (evidence: `Shop.py`)
- Item actions → Item catalog: loads catalog (evidence: `Item.py`)
- Character state → Item actions: loads item lists (evidence: `CharacterInfo.py`)
- Final score → Character state: reads player state (evidence: `FinalScore.py`)
