# hamzamurghay/pygameprojects architecture

> Architecture diagram of the GitHub repository hamzamurghay/pygameprojects, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hamzamurghay/pygameprojects
- Repository: https://github.com/hamzamurghay/pygameprojects

## Overview

##### High-Level Structure

- 8-bit Puzzle Game
- Ping Pong
- Rock Paper Scissors Simulator
- Rainbow Bouncing Square
- Platformer Gravity Simulator

- Graphics
- Sounds
- Fonts

##### Individual Game Architecture

For the Rock Paper Scissors Simulator:
- Object management system
- Collision detection system
- UI elements (counter displays, control buttons)
- Input handling (keyboard/mouse)

For the 8-bit Puzzle Game:
- Level management system
- Asset loading pipeline
- Game state controller
- Level progression system

##### Asset Management System
- Graphics pipeline
- Sound management
- Font system

##### Modularity
- How each game is independent but shares common resources
- Asset management system's centralized nature

##### State Management
- Game state controllers for each game
- How user input affects state changes

##### Resource Flow
- Demonstrate how assets are loaded and utilized
- Resource initialization paths

##### Input Handling
- Both keyboard and mouse input systems
- How input affects game state

- Any abbreviations used
- Scale indicator if necessary

This will provide a comprehensive view of the project's architecture while maintaining clarity and usefulness for development purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph PygameProjects
        CoreGames["Core Games Container"]:::core
        click CoreGames "https://github.com/HamzaMurghay/PygameProjects/tree/master/Programs"
        SharedAssets["Shared Assets"]:::shared

        subgraph Games
            Puzzle["8-bit Puzzle Game"]:::game
            click Puzzle "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/8-bit Puzzle Game/8-bit Puzzle Game.py"
            PingPong["Ping Pong"]:::game
            click PingPong "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/Ping Pong/Pygame Ping Pong.py"
            RPS["Rock Paper Scissors Simulator"]:::game
            click RPS "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/rock_paper_scissors_simulator.py"
            Rainbow["Rainbow Bouncing Square"]:::game
            click Rainbow "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/rainbow_bouncing_square.py"
            Platform["Platformer Gravity Simulator"]:::game
            click Platform "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/platformer_gravity_simulator.py"
        end

        subgraph AssetManagement
            Graphics["Graphics System"]:::asset
            click Graphics "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/graphics"
            Sounds["Sound System"]:::asset
            click Sounds "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/sounds"
            Fonts["Font System"]:::asset
            click Fonts "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/fonts"
        end

        subgraph PuzzleGame
            LevelSystem["Level Management"]:::system
            click LevelSystem "https://github.com/HamzaMurghay/PygameProjects/tree/master/Programs/8-bit Puzzle Game/Levels"
            Level1["Level 1"]:::level
            click Level1 "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/8-bit Puzzle Game/Levels/lvl1.py"
            Level2["Level 2"]:::level
            click Level2 "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/8-bit Puzzle Game/Levels/lvl2.py"
            Level4["Level 4"]:::level
            click Level4 "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/8-bit Puzzle Game/Levels/lvl4.py"
            Level5["Level 5"]:::level
            click Level5 "https://github.com/HamzaMurghay/PygameProjects/blob/master/Programs/8-bit Puzzle Game/Levels/lvl5.py"
        end

        subgraph GameAssets
            PuzzleGraphics["8-bit Puzzle Graphics"]:::gameasset
            click PuzzleGraphics "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/graphics/8-Bit Pixel Game"
            PuzzleSounds["8-bit Puzzle Sounds"]:::gameasset
            click PuzzleSounds "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/sounds/8-Bit Pixel Game"
            RPSGraphics["RPS Graphics"]:::gameasset
            click RPSGraphics "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/graphics/Rock Paper Scissors graphics"
            RPSSounds["RPS Sounds"]:::gameasset
            click RPSSounds "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/sounds/Rock Paper Scissors sounds"
            PongGraphics["Ping Pong Graphics"]:::gameasset
            click PongGraphics "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/graphics/Ping Pong"
            RainbowSounds["Rainbow Square Sounds"]:::gameasset
            click RainbowSounds "https://github.com/HamzaMurghay/PygameProjects/tree/master/assets/sounds/Rainbow Bouncing Square Sounds"
        end

        CoreGames --> Games
        SharedAssets --> AssetManagement
        Puzzle --> LevelSystem
        LevelSystem --> Level1
        LevelSystem --> Level2
        LevelSystem --> Level4
        LevelSystem --> Level5
        Graphics --> GameAssets
        Sounds --> GameAssets
    end

    %% Relationships
    Puzzle -.-> PuzzleGraphics
    Puzzle -.-> PuzzleSounds
    RPS -.-> RPSGraphics
    RPS -.-> RPSSounds
    PingPong -.-> PongGraphics
    Rainbow -.-> RainbowSounds

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef shared fill:#9b59b6,stroke:#8e44ad,color:white
    classDef game fill:#2ecc71,stroke:#27ae60,color:white
    classDef asset fill:#e74c3c,stroke:#c0392b,color:white
    classDef system fill:#f1c40f,stroke:#f39c12,color:black
    classDef level fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef gameasset fill:#1abc9c,stroke:#16a085,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Shared Resources]:::shared
        L3[Games]:::game
        L4[Asset Systems]:::asset
        L5[Game Systems]:::system
        L6[Levels]:::level
        L7[Game Assets]:::gameasset
    end
```
