# uzair567c/pong-game_using-raylib-cpp architecture

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

- Interactive diagram: https://gitdiagram.com/uzair567c/pong-game_using-raylib-cpp
- Repository: https://github.com/uzair567c/pong-game_using-raylib-cpp

## Overview

This repository is a single-file Raylib Pong game. The documented user journey runs from the main menu through mode selection into PvP or PvC play, with settings, pause, and winner screens. Game logic and screens live together in `src/game.cpp`; there is no separate application-layer implementation. The excerpts show calls to Raylib and some audio playback, while settings persistence and several screen transitions are documented in the README. The Raylib headers are bundled dependency interfaces, not game subsystems; detailed internal wiring is not established by the excerpts.

Main entry points: [`src/game.cpp`](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp) (PvP match), [`include/raylib.h`](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/raylib.h) (Raylib API), [`Extras`](https://github.com/uzair567c/pong-game_using-raylib-cpp/tree/main/Extras) (Audio assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game flow"]
  node_menu["Main menu<br/>[game.cpp]"]
  node_mode["Mode selection<br/>[game.cpp]"]
  node_pvp["PvP match<br/>[game.cpp]"]
  node_pvc["PvC match<br/>[game.cpp]"]
  node_settings["Theme settings<br/>[game.cpp]"]
  node_pause["Pause menu<br/>[game.cpp]"]
  node_winner["Winner screen<br/>[game.cpp]"]
  node_setting_store["Theme persistence<br/>[game.cpp]"]
end

subgraph group_runtime["Runtime and assets"]
  node_audio["Audio assets"]
end

subgraph group_raylib["Raylib interfaces"]
  node_raylib_api["Raylib API<br/>[raylib.h]"]
  node_raymath["Raymath API<br/>[raymath.h]"]
  node_rlgl["Rendering API<br/>[rlgl.h]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_menu
node_menu -->|"selects play"| node_mode
node_menu -->|"opens settings"| node_settings
node_mode -->|"starts PvP"| node_pvp
node_mode -->|"starts PvC"| node_pvc
node_pvp -->|"can pause"| node_pause
node_pvc -->|"can pause"| node_pause
node_pvp -->|"shows winner"| node_winner
node_pvc -->|"shows winner"| node_winner
node_pause -->|"opens settings"| node_settings
node_settings -->|"saves theme"| node_setting_store
node_pvp -->|"uses graphics and audio"| node_raylib_api
node_pvc -->|"uses graphics and audio"| node_raylib_api
node_settings -->|"uses UI and input"| node_raylib_api
node_pause -->|"uses UI and input"| node_raylib_api
node_pvp -->|"loads game sounds"| node_audio
node_pause -->|"loads button sound"| node_audio

click node_menu "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_mode "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_pvp "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_pvc "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_settings "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_pause "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_winner "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_setting_store "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp"
click node_audio "https://github.com/uzair567c/pong-game_using-raylib-cpp/tree/main/Extras"
click node_raylib_api "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/raylib.h"
click node_raymath "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/raymath.h"
click node_rlgl "https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/rlgl.h"

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_mode,node_pvp,node_pvc,node_settings,node_pause,node_winner,node_setting_store toneBlue
class node_audio toneAmber
class node_raylib_api,node_raymath,node_rlgl toneMint
class node_player toneIndigo
```

## Components

### Game flow

- [Main menu](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [Mode selection](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [PvP match](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [PvC match](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [Theme settings](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [Pause menu](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [Winner screen](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`
- [Theme persistence](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/src/game.cpp): `src/game.cpp`

### Runtime and assets

- [Audio assets](https://github.com/uzair567c/pong-game_using-raylib-cpp/tree/main/Extras): `Extras`

### Raylib interfaces

- [Raylib API](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/raylib.h): `include/raylib.h`
- [Raymath API](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/raymath.h): `include/raymath.h`
- [Rendering API](https://github.com/uzair567c/pong-game_using-raylib-cpp/blob/main/include/rlgl.h): `include/rlgl.h`

### Other components

- **Player**

## Connections

- Player → Main menu: starts game (evidence: `README.md`)
- Main menu → Mode selection: selects play (evidence: `README.md`)
- Main menu → Theme settings: opens settings (evidence: `README.md`)
- Mode selection → PvP match: starts PvP (evidence: `README.md`)
- Mode selection → PvC match: starts PvC (evidence: `README.md`)
- PvP match → Pause menu: can pause (evidence: `README.md`)
- PvC match → Pause menu: can pause (evidence: `README.md`)
- PvP match → Winner screen: shows winner (evidence: `src/game.cpp`)
- PvC match → Winner screen: shows winner (evidence: `src/game.cpp`)
- Pause menu → Theme settings: opens settings (evidence: `src/game.cpp`)
- Theme settings → Theme persistence: saves theme (evidence: `README.md`)
- PvP match → Raylib API: uses graphics and audio (evidence: `src/game.cpp`)
- PvC match → Raylib API: uses graphics and audio (evidence: `src/game.cpp`)
- Theme settings → Raylib API: uses UI and input (evidence: `src/game.cpp`)
- Pause menu → Raylib API: uses UI and input (evidence: `src/game.cpp`)
- PvP match → Audio assets: loads game sounds (evidence: `src/game.cpp`)
- Pause menu → Audio assets: loads button sound (evidence: `src/game.cpp`)
