# alegonztor/finalproject architecture

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

- Interactive diagram: https://gitdiagram.com/alegonztor/finalproject
- Repository: https://github.com/alegonztor/finalproject

## Overview

Puchipu’s Adventure is a Pygame platformer. The principal workflow is launching through the menu, loading a text-defined level, playing through movement and hazards toward a flag, and reaching a win or loss outcome. Level construction, player physics, world entities, and sound are distinct runtime concerns. The graph reflects calls visible in excerpts and imports listed in the source index; some launcher and game-loop details are only partially sampled, so uncertain links are omitted.

Main entry points: [`map.py`](https://github.com/alegonztor/finalproject/blob/main/map.py) (Map loader), [`obj.py`](https://github.com/alegonztor/finalproject/blob/main/obj.py) (Sprite base), [`character.py`](https://github.com/alegonztor/finalproject/blob/main/character.py) (Player physics), [`game.py`](https://github.com/alegonztor/finalproject/blob/main/game.py) (Game loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and outcomes"]
  node_menu["Start menu<br/>[menu.py]"]
  node_game["Game loop<br/>[game.py]"]
  node_ending["Victory screen<br/>[game_completed.py]"]
end

subgraph group_world["Level construction"]
  node_leveldata["Level layouts"]
  node_map["Map loader<br/>[map.py]"]
end

subgraph group_play["Gameplay entities"]
  node_character["Player physics<br/>[character.py]"]
  node_terrain["Ground and platforms<br/>[ground.py]"]
  node_platform["Platform geometry<br/>[platform.py]"]
  node_wall["Jump walls<br/>[wall.py]"]
  node_enemy["Chasing enemies<br/>[enemy.py]"]
  node_obstacles["Hazards<br/>[obstacle.py]"]
  node_spiketrap["Spike traps<br/>[spiketramp.py]"]
  node_retractable["Retractable spikes"]
  node_trampoline["Arrow trampoline<br/>[arrowtramp.py]"]
  node_decoration["Decorations<br/>[decoration.py]"]
end

subgraph group_support["Shared runtime"]
  node_sound["Sound manager<br/>[sounds.py]"]
  node_baseobject["Sprite base<br/>[obj.py]"]
  node_constants["Game constants<br/>[constants.py]"]
end

node_player(("Player"))

node_player -.->|"chooses start"| node_menu
node_menu -.->|"starts game"| node_game
node_game -->|"loads level"| node_map
node_map -->|"reads layout"| node_leveldata
node_game -->|"shows victory"| node_ending
node_map -->|"creates"| node_character
node_map -->|"creates"| node_terrain
node_map -->|"creates"| node_platform
node_map -->|"creates"| node_wall
node_map -->|"creates"| node_enemy
node_map -->|"creates"| node_obstacles
node_map -->|"creates"| node_spiketrap
node_map -->|"creates"| node_retractable
node_map -->|"creates"| node_trampoline
node_map -->|"creates"| node_decoration
node_character -->|"plays effects"| node_sound
node_character -.->|"inherits"| node_baseobject
node_terrain -->|"inherits"| node_baseobject
node_platform -->|"inherits"| node_baseobject
node_wall -->|"inherits"| node_baseobject
node_enemy -->|"inherits"| node_baseobject
node_obstacles -->|"inherits"| node_baseobject
node_spiketrap -->|"inherits"| node_baseobject
node_retractable -->|"inherits"| node_baseobject
node_trampoline -->|"inherits"| node_baseobject
node_decoration -->|"inherits"| node_baseobject
node_character -->|"uses dimensions"| node_constants
node_map -->|"uses dimensions"| node_constants

click node_menu "https://github.com/alegonztor/finalproject/blob/main/menu.py"
click node_game "https://github.com/alegonztor/finalproject/blob/main/game.py"
click node_ending "https://github.com/alegonztor/finalproject/blob/main/game_completed.py"
click node_leveldata "https://github.com/alegonztor/finalproject/tree/main/Levels"
click node_map "https://github.com/alegonztor/finalproject/blob/main/map.py"
click node_character "https://github.com/alegonztor/finalproject/blob/main/character.py"
click node_terrain "https://github.com/alegonztor/finalproject/blob/main/ground.py"
click node_platform "https://github.com/alegonztor/finalproject/blob/main/platform.py"
click node_wall "https://github.com/alegonztor/finalproject/blob/main/wall.py"
click node_enemy "https://github.com/alegonztor/finalproject/blob/main/enemy.py"
click node_obstacles "https://github.com/alegonztor/finalproject/blob/main/obstacle.py"
click node_spiketrap "https://github.com/alegonztor/finalproject/blob/main/spiketramp.py"
click node_retractable "https://github.com/alegonztor/finalproject/blob/main/retractable_spike.py"
click node_trampoline "https://github.com/alegonztor/finalproject/blob/main/arrowtramp.py"
click node_decoration "https://github.com/alegonztor/finalproject/blob/main/decoration.py"
click node_sound "https://github.com/alegonztor/finalproject/blob/main/sounds.py"
click node_baseobject "https://github.com/alegonztor/finalproject/blob/main/obj.py"
click node_constants "https://github.com/alegonztor/finalproject/blob/main/constants.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_menu,node_game,node_ending toneBlue
class node_leveldata,node_map toneAmber
class node_character,node_terrain,node_platform,node_wall,node_enemy,node_obstacles,node_spiketrap,node_retractable,node_trampoline,node_decoration toneMint
class node_sound,node_baseobject,node_constants toneRose
class node_player toneIndigo
```

## Components

### Launch and outcomes

- [Start menu](https://github.com/alegonztor/finalproject/blob/main/menu.py): `menu.py`
- [Game loop](https://github.com/alegonztor/finalproject/blob/main/game.py): `game.py`
- [Victory screen](https://github.com/alegonztor/finalproject/blob/main/game_completed.py): `game_completed.py`

### Level construction

- [Level layouts](https://github.com/alegonztor/finalproject/tree/main/Levels): `Levels`
- [Map loader](https://github.com/alegonztor/finalproject/blob/main/map.py): `map.py`

### Gameplay entities

- [Player physics](https://github.com/alegonztor/finalproject/blob/main/character.py): `character.py`
- [Ground and platforms](https://github.com/alegonztor/finalproject/blob/main/ground.py): `ground.py`
- [Platform geometry](https://github.com/alegonztor/finalproject/blob/main/platform.py): `platform.py`
- [Jump walls](https://github.com/alegonztor/finalproject/blob/main/wall.py): `wall.py`
- [Chasing enemies](https://github.com/alegonztor/finalproject/blob/main/enemy.py): `enemy.py`
- [Hazards](https://github.com/alegonztor/finalproject/blob/main/obstacle.py): `obstacle.py`
- [Spike traps](https://github.com/alegonztor/finalproject/blob/main/spiketramp.py): `spiketramp.py`
- [Retractable spikes](https://github.com/alegonztor/finalproject/blob/main/retractable_spike.py): `retractable_spike.py`
- [Arrow trampoline](https://github.com/alegonztor/finalproject/blob/main/arrowtramp.py): `arrowtramp.py`
- [Decorations](https://github.com/alegonztor/finalproject/blob/main/decoration.py): `decoration.py`

### Shared runtime

- [Sound manager](https://github.com/alegonztor/finalproject/blob/main/sounds.py): `sounds.py`
- [Sprite base](https://github.com/alegonztor/finalproject/blob/main/obj.py): `obj.py`
- [Game constants](https://github.com/alegonztor/finalproject/blob/main/constants.py): `constants.py`

### Other components

- **Player**

## Connections

- Player → Start menu: chooses start
- Start menu → Game loop: starts game
- Game loop → Map loader: loads level (evidence: `game.py`)
- Map loader → Level layouts: reads layout (evidence: `map.py`)
- Game loop → Victory screen: shows victory (evidence: `game.py`)
- Map loader → Player physics: creates (evidence: `map.py`)
- Map loader → Ground and platforms: creates (evidence: `map.py`)
- Map loader → Platform geometry: creates (evidence: `map.py`)
- Map loader → Jump walls: creates (evidence: `map.py`)
- Map loader → Chasing enemies: creates (evidence: `map.py`)
- Map loader → Hazards: creates (evidence: `map.py`)
- Map loader → Spike traps: creates (evidence: `map.py`)
- Map loader → Retractable spikes: creates (evidence: `map.py`)
- Map loader → Arrow trampoline: creates (evidence: `map.py`)
- Map loader → Decorations: creates (evidence: `map.py`)
- Player physics → Sound manager: plays effects (evidence: `character.py`)
- Player physics → Sprite base: inherits
- Ground and platforms → Sprite base: inherits (evidence: `ground.py`)
- Platform geometry → Sprite base: inherits (evidence: `platform.py`)
- Jump walls → Sprite base: inherits (evidence: `wall.py`)
- Chasing enemies → Sprite base: inherits (evidence: `enemy.py`)
- Hazards → Sprite base: inherits (evidence: `obstacle.py`)
- Spike traps → Sprite base: inherits (evidence: `spiketramp.py`)
- Retractable spikes → Sprite base: inherits (evidence: `retractable_spike.py`)
- Arrow trampoline → Sprite base: inherits (evidence: `arrowtramp.py`)
- Decorations → Sprite base: inherits (evidence: `decoration.py`)
- Player physics → Game constants: uses dimensions (evidence: `character.py`)
- Map loader → Game constants: uses dimensions (evidence: `map.py`)
