# calab/wingline architecture

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

- Interactive diagram: https://gitdiagram.com/calab/wingline
- Repository: https://github.com/calab/wingline

## Overview

Wingline is a first-person Flappy Bird-style game. The player starts from the title screen, steers through increasingly difficult wall openings, and sees run results and saved best/last-run markers. The main runtime separates screen/input orchestration, world simulation, rendering, and theme/settings resources. The excerpts establish theme loading, world creation, rendering calls, and settings persistence; unsampled loop details are not used to assert additional call edges.

Main entry points: [`flappy/game.py`](https://github.com/calab/wingline/blob/main/flappy/game.py) (Game Controller), [`flappy/config.py`](https://github.com/calab/wingline/blob/main/flappy/config.py) (Game Configuration), [`flappy/renderer.py`](https://github.com/calab/wingline/blob/main/flappy/renderer.py) (Scene Renderer), [`flappy/resources.py`](https://github.com/calab/wingline/blob/main/flappy/resources.py) (Theme Loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_launcher["Game Entry<br/>[main.py]"]
  node_game["Game Controller<br/>[game.py]"]
  node_screens["Screens and Input<br/>[game.py]"]
  node_config["Game Configuration<br/>[config.py]"]
end

subgraph group_simulation["World Simulation"]
  node_world["World Simulation<br/>[world.py]"]
  node_wall_rules["Wall Rules<br/>[world.py]"]
  node_run_stats["Lives and Stats<br/>[world.py]"]
end

subgraph group_presentation["Presentation"]
  node_renderer["Scene Renderer<br/>[renderer.py]"]
  node_hud["HUD and Guides<br/>[renderer.py]"]
end

subgraph group_resources["Themes and Settings"]
  node_theme_loader["Theme Loader<br/>[resources.py]"]
  node_theme_assets["Theme Assets"]
  node_settings[("Settings Store<br/>[resources.py]")]
end

node_player(("Player"))

node_player -->|"starts game"| node_launcher
node_launcher -->|"runs"| node_game
node_game -->|"loads themes"| node_theme_loader
node_game -->|"creates world"| node_world
node_game -->|"draws screens"| node_renderer
node_game -->|"saves run markers"| node_settings
node_theme_loader -->|"loads assets"| node_theme_assets
node_theme_loader -->|"reads settings"| node_settings
node_settings -->|"uses settings path"| node_config
node_renderer -->|"draws HUD"| node_hud
node_game -->|"uses game constants"| node_config
node_world -->|"uses rule constants"| node_config
node_renderer -->|"uses render constants"| node_config

click node_launcher "https://github.com/calab/wingline/blob/main/main.py"
click node_game "https://github.com/calab/wingline/blob/main/flappy/game.py"
click node_screens "https://github.com/calab/wingline/blob/main/flappy/game.py"
click node_world "https://github.com/calab/wingline/blob/main/flappy/world.py"
click node_wall_rules "https://github.com/calab/wingline/blob/main/flappy/world.py"
click node_run_stats "https://github.com/calab/wingline/blob/main/flappy/world.py"
click node_renderer "https://github.com/calab/wingline/blob/main/flappy/renderer.py"
click node_hud "https://github.com/calab/wingline/blob/main/flappy/renderer.py"
click node_theme_loader "https://github.com/calab/wingline/blob/main/flappy/resources.py"
click node_theme_assets "https://github.com/calab/wingline/tree/main/resources/themes"
click node_settings "https://github.com/calab/wingline/blob/main/flappy/resources.py"
click node_config "https://github.com/calab/wingline/blob/main/flappy/config.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_launcher,node_game,node_screens,node_config toneBlue
class node_world,node_wall_rules,node_run_stats toneAmber
class node_renderer,node_hud toneMint
class node_theme_loader,node_theme_assets,node_settings toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game Entry](https://github.com/calab/wingline/blob/main/main.py): `main.py`
- [Game Controller](https://github.com/calab/wingline/blob/main/flappy/game.py): `flappy/game.py`
- [Screens and Input](https://github.com/calab/wingline/blob/main/flappy/game.py): `flappy/game.py`
- [Game Configuration](https://github.com/calab/wingline/blob/main/flappy/config.py): `flappy/config.py`

### World Simulation

- [World Simulation](https://github.com/calab/wingline/blob/main/flappy/world.py): `flappy/world.py`
- [Wall Rules](https://github.com/calab/wingline/blob/main/flappy/world.py): `flappy/world.py`
- [Lives and Stats](https://github.com/calab/wingline/blob/main/flappy/world.py): `flappy/world.py`

### Presentation

- [Scene Renderer](https://github.com/calab/wingline/blob/main/flappy/renderer.py): `flappy/renderer.py`
- [HUD and Guides](https://github.com/calab/wingline/blob/main/flappy/renderer.py): `flappy/renderer.py`

### Themes and Settings

- [Theme Loader](https://github.com/calab/wingline/blob/main/flappy/resources.py): `flappy/resources.py`
- [Theme Assets](https://github.com/calab/wingline/tree/main/resources/themes): `resources/themes`
- [Settings Store](https://github.com/calab/wingline/blob/main/flappy/resources.py): `flappy/resources.py`

### Other components

- **Player**

## Connections

- Player → Game Entry: starts game (evidence: `README.md`)
- Game Entry → Game Controller: runs (evidence: `main.py`)
- Game Controller → Theme Loader: loads themes (evidence: `flappy/game.py`)
- Game Controller → World Simulation: creates world (evidence: `flappy/game.py`)
- Game Controller → Scene Renderer: draws screens (evidence: `flappy/game.py`)
- Game Controller → Settings Store: saves run markers (evidence: `flappy/game.py`)
- Theme Loader → Theme Assets: loads assets (evidence: `flappy/resources.py`)
- Theme Loader → Settings Store: reads settings (evidence: `flappy/resources.py`)
- Settings Store → Game Configuration: uses settings path (evidence: `flappy/resources.py`)
- Scene Renderer → HUD and Guides: draws HUD (evidence: `flappy/renderer.py`)
- Game Controller → Game Configuration: uses game constants (evidence: `flappy/game.py`)
- World Simulation → Game Configuration: uses rule constants (evidence: `flappy/world.py`)
- Scene Renderer → Game Configuration: uses render constants (evidence: `flappy/renderer.py`)
