# dhankeerth/flappycomputervision architecture

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

- Interactive diagram: https://gitdiagram.com/dhankeerth/flappycomputervision
- Repository: https://github.com/dhankeerth/flappycomputervision

## Overview

This is a webcam-controlled Flappy Bird game. The user starts the application; its entry point creates the game and gesture controller, then runs the game loop while hand tracking runs on a daemon thread. Pinching dispatches a flap to the game, whose gameplay, rendering, and interface produce the on-screen result. The README documents additional visual and scoring features; because most of game.py and gesture_controller.py were not sampled, internal links beyond the shown entry-point wiring are limited to documented relationships.

Main entry points: [`game.py`](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py) (Game loop), [`main.py`](https://github.com/dhankeerth/flappycomputervision/blob/main/main.py) (Application entry), [`gesture_controller.py`](https://github.com/dhankeerth/flappycomputervision/blob/main/gesture_controller.py) (Hand tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application runtime"]
  node_entry["Application entry<br/>[main.py]"]
end

subgraph group_vision["Gesture input"]
  node_tracker["Hand tracking"]
  node_pinch["Pinch detection"]
end

subgraph group_gameplay["Game experience"]
  node_game["Game loop<br/>[game.py]"]
  node_bird["Bird physics<br/>[game.py]"]
  node_obstacles["Pipes and collision<br/>[game.py]"]
  node_scenery["Scrolling scenery<br/>[game.py]"]
  node_interface["Menus and scoreboard<br/>[game.py]"]
  node_effects["Visual effects<br/>[game.py]"]
end

node_player(("Player"))
node_webcam["Webcam"]

node_player -->|"starts"| node_entry
node_entry -->|"creates and runs"| node_game
node_entry -->|"starts thread"| node_tracker
node_webcam -->|"provides frames"| node_tracker
node_tracker -->|"tracks landmarks"| node_pinch
node_pinch -->|"dispatches flap"| node_game
node_game -->|"updates and draws"| node_bird
node_game -->|"manages gameplay"| node_obstacles
node_game -->|"renders scenery"| node_scenery
node_game -->|"renders interface"| node_interface
node_game -->|"renders effects"| node_effects

click node_entry "https://github.com/dhankeerth/flappycomputervision/blob/main/main.py"
click node_game "https://github.com/dhankeerth/flappycomputervision/blob/main/game.py"
click node_tracker "https://github.com/dhankeerth/flappycomputervision/blob/main/gesture_controller.py"
click node_pinch "https://github.com/dhankeerth/flappycomputervision/blob/main/gesture_controller.py"
click node_bird "https://github.com/dhankeerth/flappycomputervision/blob/main/game.py"
click node_obstacles "https://github.com/dhankeerth/flappycomputervision/blob/main/game.py"
click node_scenery "https://github.com/dhankeerth/flappycomputervision/blob/main/game.py"
click node_interface "https://github.com/dhankeerth/flappycomputervision/blob/main/game.py"
click node_effects "https://github.com/dhankeerth/flappycomputervision/blob/main/game.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_entry toneBlue
class node_tracker,node_pinch toneAmber
class node_game,node_bird,node_obstacles,node_scenery,node_interface,node_effects toneMint
class node_player,node_webcam toneIndigo
```

## Components

### Application runtime

- [Application entry](https://github.com/dhankeerth/flappycomputervision/blob/main/main.py): `main.py`

### Gesture input

- [Hand tracking](https://github.com/dhankeerth/flappycomputervision/blob/main/gesture_controller.py): `gesture_controller.py`
- [Pinch detection](https://github.com/dhankeerth/flappycomputervision/blob/main/gesture_controller.py): `gesture_controller.py`

### Game experience

- [Game loop](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py): `game.py`
- [Bird physics](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py): `game.py`
- [Pipes and collision](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py): `game.py`
- [Scrolling scenery](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py): `game.py`
- [Menus and scoreboard](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py): `game.py`
- [Visual effects](https://github.com/dhankeerth/flappycomputervision/blob/main/game.py): `game.py`

### Other components

- **Player**
- **Webcam**

## Connections

- Player → Application entry: starts (evidence: `README.md`)
- Application entry → Game loop: creates and runs (evidence: `main.py`)
- Application entry → Hand tracking: starts thread (evidence: `main.py`)
- Webcam → Hand tracking: provides frames (evidence: `README.md`)
- Hand tracking → Pinch detection: tracks landmarks (evidence: `README.md`)
- Pinch detection → Game loop: dispatches flap (evidence: `README.md`)
- Game loop → Bird physics: updates and draws (evidence: `README.md`)
- Game loop → Pipes and collision: manages gameplay (evidence: `README.md`)
- Game loop → Scrolling scenery: renders scenery (evidence: `README.md`)
- Game loop → Menus and scoreboard: renders interface (evidence: `README.md`)
- Game loop → Visual effects: renders effects (evidence: `README.md`)
