# jonesy200/pygame_practice architecture

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

- Interactive diagram: https://gitdiagram.com/jonesy200/pygame_practice
- Repository: https://github.com/jonesy200/pygame_practice

## Overview

This repository is a small Pygame platformer prototype, with a procedural character-control loop in `OOP/` and an earlier, self-contained loop in the root `main.py`. In the OOP version, input is handled by `Game`, which drives `Player` movement and updates; `Player` loads animation frames and resolves floor contact, while `Game` draws the floor and player. The asset tree includes additional character and effect animations beyond those loaded in the sampled code. The README is empty, and only the sampled source supports the relationships shown.

Main entry points: [`OOP/main.py`](https://github.com/jonesy200/pygame_practice/blob/master/OOP/main.py) (OOP game loop), [`main.py`](https://github.com/jonesy200/pygame_practice/blob/master/main.py) (Prototype loop), [`OOP/player.py`](https://github.com/jonesy200/pygame_practice/blob/master/OOP/player.py) (Player), [`OOP/animation.py`](https://github.com/jonesy200/pygame_practice/blob/master/OOP/animation.py) (Animation loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game loops"]
  node_oop_game["OOP game loop<br/>[main.py]"]
  node_prototype["Prototype loop<br/>[main.py]"]
end

subgraph group_character["Character runtime"]
  node_player["Player<br/>[player.py]"]
  node_animations["Animation loader<br/>[animation.py]"]
  node_floor["Floor<br/>[floor.py]"]
end

subgraph group_assets["Game assets"]
  node_character_sprites["Character sprites"]
  node_effect_sprites["Effects and tiles"]
  node_sound["Clank sound<br/>[clank.wav]"]
end

node_player_actor(("Player"))
node_display["Pygame display"]

node_player_actor -->|"provides input"| node_oop_game
node_oop_game -->|"controls and updates"| node_player
node_oop_game -->|"draws and passes floor"| node_floor
node_player -->|"loads frames"| node_animations
node_animations -->|"loads images"| node_character_sprites
node_oop_game -->|"draws frame"| node_display
node_player_actor -->|"provides input"| node_prototype
node_prototype -->|"loads frames"| node_character_sprites
node_prototype -->|"plays on key"| node_sound
node_prototype -->|"draws frame"| node_display

click node_player "https://github.com/jonesy200/pygame_practice/blob/master/OOP/player.py"
click node_animations "https://github.com/jonesy200/pygame_practice/blob/master/OOP/animation.py"
click node_floor "https://github.com/jonesy200/pygame_practice/blob/master/OOP/floor.py"
click node_oop_game "https://github.com/jonesy200/pygame_practice/blob/master/OOP/main.py"
click node_prototype "https://github.com/jonesy200/pygame_practice/blob/master/main.py"
click node_character_sprites "https://github.com/jonesy200/pygame_practice/tree/master/Hero%20Knight/Sprites/HeroKnight"
click node_effect_sprites "https://github.com/jonesy200/pygame_practice/tree/master/Hero%20Knight/Sprites"
click node_sound "https://github.com/jonesy200/pygame_practice/blob/master/sounds/clank.wav"

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_oop_game,node_prototype toneBlue
class node_player,node_animations,node_floor toneAmber
class node_character_sprites,node_effect_sprites,node_sound toneMint
class node_player_actor,node_display toneIndigo
```

## Components

### Game loops

- [OOP game loop](https://github.com/jonesy200/pygame_practice/blob/master/OOP/main.py): `OOP/main.py`
- [Prototype loop](https://github.com/jonesy200/pygame_practice/blob/master/main.py): `main.py`

### Character runtime

- [Player](https://github.com/jonesy200/pygame_practice/blob/master/OOP/player.py): `OOP/player.py`
- [Animation loader](https://github.com/jonesy200/pygame_practice/blob/master/OOP/animation.py): `OOP/animation.py`
- [Floor](https://github.com/jonesy200/pygame_practice/blob/master/OOP/floor.py): `OOP/floor.py`

### Game assets

- [Character sprites](https://github.com/jonesy200/pygame_practice/tree/master/Hero%20Knight/Sprites/HeroKnight): `Hero Knight/Sprites/HeroKnight`
- [Effects and tiles](https://github.com/jonesy200/pygame_practice/tree/master/Hero%20Knight/Sprites): `Hero Knight/Sprites`
- [Clank sound](https://github.com/jonesy200/pygame_practice/blob/master/sounds/clank.wav): `sounds/clank.wav`

### Other components

- **Player**
- **Pygame display**

## Connections

- Player → OOP game loop: provides input
- OOP game loop → Player: controls and updates
- OOP game loop → Floor: draws and passes floor
- Player → Animation loader: loads frames
- Animation loader → Character sprites: loads images
- OOP game loop → Pygame display: draws frame
- Player → Prototype loop: provides input
- Prototype loop → Character sprites: loads frames
- Prototype loop → Clank sound: plays on key
- Prototype loop → Pygame display: draws frame
