# vizzaq23/pinball-scoreboard architecture

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

- Interactive diagram: https://gitdiagram.com/vizzaq23/pinball-scoreboard
- Repository: https://github.com/vizzaq23/pinball-scoreboard

## Overview

This repository is a Python/Pygame pinball scoreboard integrated with Raspberry Pi GPIO, with keyboard input for desktop development. A player starts the game, then gameplay handles scoring and mode changes while polling physical or simulated inputs; the display and audio respond to play. Hardware setup and asset/audio loading are separate internal layers. The README also describes a service/diagnostics mode, but its implementation file is absent from the supplied tree. Edges reflect the sampled imports and documented capabilities; unsampled details are not inferred.

Main entry points: [`game.py`](https://github.com/vizzaq23/pinball-scoreboard/blob/main/game.py) (Game loop and scoring), [`audio.py`](https://github.com/vizzaq23/pinball-scoreboard/blob/main/audio.py) (Sound and music), [`hardware.py`](https://github.com/vizzaq23/pinball-scoreboard/blob/main/hardware.py) (GPIO abstraction), [`assets.py`](https://github.com/vizzaq23/pinball-scoreboard/blob/main/assets.py) (Asset loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game flow"]
  node_game["Game loop and scoring<br/>[game.py]"]
  node_diagnostics["Service diagnostics"]
end

subgraph group_presentation["Display and audio"]
  node_assets["Asset loading<br/>[assets.py]"]
  node_audio["Sound and music<br/>[audio.py]"]
end

subgraph group_hardware["Hardware integration"]
  node_hardware["GPIO abstraction<br/>[hardware.py]"]
end

node_player(("Player"))
node_gpio["Raspberry Pi GPIO"]

node_player -->|"plays"| node_game
node_player -->|"simulates inputs"| node_game
node_game -->|"polls and controls"| node_hardware
node_game -->|"plays sounds"| node_audio
node_game -->|"loads images"| node_assets
node_audio -->|"loads sounds"| node_assets
node_hardware -->|"uses GPIO"| node_gpio
node_game -->|"runs service mode"| node_diagnostics

click node_game "https://github.com/vizzaq23/pinball-scoreboard/blob/main/game.py"
click node_assets "https://github.com/vizzaq23/pinball-scoreboard/blob/main/assets.py"
click node_audio "https://github.com/vizzaq23/pinball-scoreboard/blob/main/audio.py"
click node_hardware "https://github.com/vizzaq23/pinball-scoreboard/blob/main/hardware.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_game,node_diagnostics toneBlue
class node_assets,node_audio toneAmber
class node_hardware toneMint
class node_player,node_gpio toneIndigo
```

## Components

### Game flow

- [Game loop and scoring](https://github.com/vizzaq23/pinball-scoreboard/blob/main/game.py): `game.py`
- **Service diagnostics**

### Display and audio

- [Asset loading](https://github.com/vizzaq23/pinball-scoreboard/blob/main/assets.py): `assets.py`
- [Sound and music](https://github.com/vizzaq23/pinball-scoreboard/blob/main/audio.py): `audio.py`

### Hardware integration

- [GPIO abstraction](https://github.com/vizzaq23/pinball-scoreboard/blob/main/hardware.py): `hardware.py`

### Other components

- **Player**
- **Raspberry Pi GPIO**

## Connections

- Player → Game loop and scoring: plays (evidence: `README.md`)
- Player → Game loop and scoring: simulates inputs (evidence: `README.md`)
- Game loop and scoring → GPIO abstraction: polls and controls (evidence: `game.py`)
- Game loop and scoring → Sound and music: plays sounds (evidence: `game.py`)
- Game loop and scoring → Asset loading: loads images (evidence: `game.py`)
- Sound and music → Asset loading: loads sounds (evidence: `audio.py`)
- GPIO abstraction → Raspberry Pi GPIO: uses GPIO (evidence: `hardware.py`)
- Game loop and scoring → Service diagnostics: runs service mode (evidence: `README.md`)
