# riddh619/flappy-elon architecture

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

- Interactive diagram: https://gitdiagram.com/riddh619/flappy-elon
- Repository: https://github.com/riddh619/flappy-elon

## Overview

Flappy Elon is a Pygame game. The player starts or restarts from the menu, flaps through scrolling pipe gaps, earns points, and reaches a game-over screen after a collision; the game loop also tracks a session high score and increases pipe speed as the score rises. The graph separates game flow, gameplay entities, and shared configuration and assets. Relationships are based on the README and sampled source; unsampled asset behavior is represented only where the sampled code or README supports it.

Main entry points: [`FlappyBird/main.py`](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/main.py) (Game loop and screens), [`FlappyBird/config.py`](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/config.py) (Game configuration), [`FlappyBird/assets/images`](https://github.com/riddh619/flappy-elon/tree/main/FlappyBird/assets/images) (Image assets), [`FlappyBird/audio.py`](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/audio.py) (Audio manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Game flow and UI"]
  node_loop["Game loop and screens<br/>[main.py]"]
  node_audio["Audio manager<br/>[audio.py]"]
end

subgraph group_entities["Gameplay entities"]
  node_bird["Bird physics<br/>[bird.py]"]
  node_pipes["Pipe pairs<br/>[pipe.py]"]
  node_ground["Scrolling ground<br/>[ground.py]"]
end

subgraph group_shared["Shared settings and assets"]
  node_config["Game configuration<br/>[config.py]"]
  node_images["Image assets"]
  node_sounds["Audio assets"]
end

node_player(("Player"))

node_player -->|"starts and controls"| node_loop
node_loop -->|"updates and draws"| node_bird
node_loop -->|"spawns and checks"| node_pipes
node_loop -->|"updates and draws"| node_ground
node_loop -->|"plays game sounds"| node_audio
node_loop -->|"reads settings"| node_config
node_bird -->|"reads physics settings"| node_config
node_pipes -->|"reads pipe settings"| node_config
node_ground -->|"reads ground settings"| node_config
node_audio -->|"reads audio paths"| node_config
node_bird -->|"loads bird sprite"| node_images
node_pipes -->|"loads pipe sprite"| node_images
node_ground -->|"loads ground image"| node_images
node_loop -->|"loads optional background"| node_images
node_audio -->|"loads music and effects"| node_sounds

click node_loop "https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/main.py"
click node_bird "https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/bird.py"
click node_pipes "https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/pipe.py"
click node_ground "https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/ground.py"
click node_audio "https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/audio.py"
click node_config "https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/config.py"
click node_images "https://github.com/riddh619/flappy-elon/tree/main/FlappyBird/assets/images"
click node_sounds "https://github.com/riddh619/flappy-elon/tree/main/FlappyBird/assets/audio"

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_loop,node_audio toneBlue
class node_bird,node_pipes,node_ground toneAmber
class node_config,node_images,node_sounds toneMint
class node_player toneIndigo
```

## Components

### Game flow and UI

- [Game loop and screens](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/main.py): `FlappyBird/main.py`
- [Audio manager](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/audio.py): `FlappyBird/audio.py`

### Gameplay entities

- [Bird physics](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/bird.py): `FlappyBird/bird.py`
- [Pipe pairs](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/pipe.py): `FlappyBird/pipe.py`
- [Scrolling ground](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/ground.py): `FlappyBird/ground.py`

### Shared settings and assets

- [Game configuration](https://github.com/riddh619/flappy-elon/blob/main/FlappyBird/config.py): `FlappyBird/config.py`
- [Image assets](https://github.com/riddh619/flappy-elon/tree/main/FlappyBird/assets/images): `FlappyBird/assets/images`
- [Audio assets](https://github.com/riddh619/flappy-elon/tree/main/FlappyBird/assets/audio): `FlappyBird/assets/audio`

### Other components

- **Player**

## Connections

- Player → Game loop and screens: starts and controls (evidence: `README.md`)
- Game loop and screens → Bird physics: updates and draws (evidence: `FlappyBird/main.py`)
- Game loop and screens → Pipe pairs: spawns and checks (evidence: `FlappyBird/main.py`)
- Game loop and screens → Scrolling ground: updates and draws (evidence: `FlappyBird/main.py`)
- Game loop and screens → Audio manager: plays game sounds (evidence: `FlappyBird/main.py`)
- Game loop and screens → Game configuration: reads settings (evidence: `FlappyBird/main.py`)
- Bird physics → Game configuration: reads physics settings (evidence: `FlappyBird/bird.py`)
- Pipe pairs → Game configuration: reads pipe settings (evidence: `FlappyBird/pipe.py`)
- Scrolling ground → Game configuration: reads ground settings (evidence: `FlappyBird/ground.py`)
- Audio manager → Game configuration: reads audio paths (evidence: `FlappyBird/audio.py`)
- Bird physics → Image assets: loads bird sprite (evidence: `FlappyBird/bird.py`)
- Pipe pairs → Image assets: loads pipe sprite (evidence: `FlappyBird/pipe.py`)
- Scrolling ground → Image assets: loads ground image (evidence: `FlappyBird/ground.py`)
- Game loop and screens → Image assets: loads optional background (evidence: `FlappyBird/main.py`)
- Audio manager → Audio assets: loads music and effects (evidence: `FlappyBird/audio.py`)
