# mohammad-abu-aresh/pacman architecture

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

- Interactive diagram: https://gitdiagram.com/mohammad-abu-aresh/pacman
- Repository: https://github.com/mohammad-abu-aresh/pacman
- Video tour (about a minute): https://gitdiagram.com/mohammad-abu-aresh/pacman/video

## Overview

This is a Python, Minecraft-themed Pac-Man game. The principal workflow is launch and configuration, menu-driven session creation, procedural maze construction, entity play, and level or game-state progression; the UI also supports leaderboard interaction. The graph preserves documented features such as scoring, pellets, monster AI, hardcore abilities, and multi-level play, although their implementation details were not all sampled. Some README architecture claims do not match the supplied tree, so those components use existing enclosing paths and uncertain links are omitted or marked unverified.

Main entry points: [`game/gameengine.py`](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameengine.py) (Game engine), [`game/gameplay.py`](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameplay.py) (Gameplay session), [`game/creature`](https://github.com/mohammad-abu-aresh/pacman/tree/main/game/creature) (Monster personalities), [`game/creature/creature.py`](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/creature.py) (Creature control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_launcher["CLI launcher<br/>[pac-man.py]"]
  node_engine["Game engine<br/>[gameengine.py]"]
  node_config["Configuration<br/>[configLoader.py]"]
  node_modes["Game modes<br/>[game_modes.py]"]
end

subgraph group_world["Maze and levels"]
  node_session["Gameplay session<br/>[gameplay.py]"]
  node_maze_adapter["Maze adapter<br/>[block.py]"]
  node_generator["Maze generator"]
  node_pellets_scoring["Pellets and scoring<br/>[gameplay.py]"]
end

subgraph group_entities["Entities and behavior"]
  node_creature_control["Creature control<br/>[creature.py]"]
  node_player["Player entity<br/>[player.py]"]
  node_monster_base["Monster base<br/>[monster.py]"]
  node_personalities["Monster personalities"]
  node_pathfinding["Pathfinding<br/>[bfs.py]"]
  node_monster_algo["Monster AI<br/>[algo_monster.py]"]
  node_abilities["Hardcore abilities<br/>[abilities.py]"]
end

subgraph group_interface["Interface and assets"]
  node_screens["Screens and leaderboard<br/>[screens.py]"]
  node_images["Image assets<br/>[loderimages.py]"]
  node_highscores[("Highscore storage<br/>[highscores.json]")]
end

node_player_actor(("Player"))

node_player_actor -->|"launches"| node_launcher
node_launcher -->|"starts"| node_engine
node_engine -->|"creates"| node_screens
node_engine -->|"creates"| node_session
node_engine -->|"updates state"| node_modes
node_engine -->|"uses display"| node_images
node_engine -->|"saves scores"| node_highscores
node_engine -.->|"uses settings"| node_config
node_session -->|"adapts maze"| node_maze_adapter
node_session -->|"generates maze"| node_generator
node_maze_adapter -->|"reads maze"| node_generator
node_session -->|"creates entities"| node_creature_control
node_session -.->|"manages gameplay"| node_pellets_scoring
node_creature_control -->|"creates"| node_player
node_creature_control -->|"creates"| node_personalities
node_personalities -->|"inherits"| node_monster_base
node_monster_algo -->|"uses search"| node_pathfinding
node_personalities -.->|"delegates AI"| node_monster_algo
node_personalities -->|"uses abilities"| node_abilities
node_screens -.->|"displays scores"| node_highscores
node_screens -.->|"renders assets"| node_images

click node_launcher "https://github.com/mohammad-abu-aresh/pacman/blob/main/pac-man.py"
click node_engine "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameengine.py"
click node_config "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/configLoader.py"
click node_modes "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/game_modes.py"
click node_session "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameplay.py"
click node_maze_adapter "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/block.py"
click node_pellets_scoring "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameplay.py"
click node_creature_control "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/creature.py"
click node_player "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/player.py"
click node_monster_base "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/monster.py"
click node_personalities "https://github.com/mohammad-abu-aresh/pacman/tree/main/game/creature"
click node_pathfinding "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/bfs.py"
click node_monster_algo "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/algo_monster.py"
click node_abilities "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/abilities.py"
click node_screens "https://github.com/mohammad-abu-aresh/pacman/blob/main/game/screens.py"
click node_images "https://github.com/mohammad-abu-aresh/pacman/blob/main/photos/loderimages.py"
click node_highscores "https://github.com/mohammad-abu-aresh/pacman/blob/main/highscores.json"

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_launcher,node_engine,node_config,node_modes toneBlue
class node_session,node_maze_adapter,node_generator,node_pellets_scoring toneAmber
class node_creature_control,node_player,node_monster_base,node_personalities,node_pathfinding,node_monster_algo,node_abilities toneMint
class node_screens,node_images,node_highscores toneRose
class node_player_actor toneIndigo
```

## Components

### Game runtime

- [CLI launcher](https://github.com/mohammad-abu-aresh/pacman/blob/main/pac-man.py): `pac-man.py`
- [Game engine](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameengine.py): `game/gameengine.py`
- [Configuration](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/configLoader.py): `game/configLoader.py`
- [Game modes](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/game_modes.py): `game/game_modes.py`

### Maze and levels

- [Gameplay session](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameplay.py): `game/gameplay.py`
- [Maze adapter](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/block.py): `game/block.py`
- **Maze generator**
- [Pellets and scoring](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/gameplay.py): `game/gameplay.py`

### Entities and behavior

- [Creature control](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/creature.py): `game/creature/creature.py`
- [Player entity](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/player.py): `game/creature/player.py`
- [Monster base](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/monster.py): `game/creature/monster.py`
- [Monster personalities](https://github.com/mohammad-abu-aresh/pacman/tree/main/game/creature): `game/creature`
- [Pathfinding](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/bfs.py): `game/creature/bfs.py`
- [Monster AI](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/algo_monster.py): `game/creature/algo_monster.py`
- [Hardcore abilities](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/creature/abilities.py): `game/creature/abilities.py`

### Interface and assets

- [Screens and leaderboard](https://github.com/mohammad-abu-aresh/pacman/blob/main/game/screens.py): `game/screens.py`
- [Image assets](https://github.com/mohammad-abu-aresh/pacman/blob/main/photos/loderimages.py): `photos/loderimages.py`
- [Highscore storage](https://github.com/mohammad-abu-aresh/pacman/blob/main/highscores.json): `highscores.json`

### Other components

- **Player**

## Connections

- Player → CLI launcher: launches (evidence: `README.md`)
- CLI launcher → Game engine: starts
- Game engine → Screens and leaderboard: creates (evidence: `game/gameengine.py`)
- Game engine → Gameplay session: creates (evidence: `game/gameengine.py`)
- Game engine → Game modes: updates state (evidence: `game/gameengine.py`)
- Game engine → Image assets: uses display (evidence: `game/gameengine.py`)
- Game engine → Highscore storage: saves scores (evidence: `game/gameengine.py`)
- Game engine → Configuration: uses settings
- Gameplay session → Maze adapter: adapts maze (evidence: `game/gameplay.py`)
- Gameplay session → Maze generator: generates maze (evidence: `game/gameplay.py`)
- Maze adapter → Maze generator: reads maze (evidence: `game/block.py`)
- Gameplay session → Creature control: creates entities (evidence: `game/gameplay.py`)
- Gameplay session → Pellets and scoring: manages gameplay (evidence: `game/gameplay.py`)
- Creature control → Player entity: creates (evidence: `game/creature/creature.py`)
- Creature control → Monster personalities: creates (evidence: `game/creature/creature.py`)
- Monster personalities → Monster base: inherits (evidence: `game/creature/monster.py`)
- Monster AI → Pathfinding: uses search (evidence: `game/creature/algo_monster.py`)
- Monster personalities → Monster AI: delegates AI (evidence: `game/creature/algo_monster.py`)
- Monster personalities → Hardcore abilities: uses abilities (evidence: `game/creature/skeleton.py`)
- Screens and leaderboard → Highscore storage: displays scores
- Screens and leaderboard → Image assets: renders assets
