# harsh-ongit/hill-climb-gesture-control architecture

> Architecture diagram of the GitHub repository harsh-ongit/hill-climb-gesture-control, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harsh-ongit/hill-climb-gesture-control
- Repository: https://github.com/harsh-ongit/hill-climb-gesture-control

## Overview

This small Python app turns webcam frames into hand gestures and keyboard input for Hill Climb Racing. The main loop captures and processes frames, classifies finger positions, updates key state, and displays a preview. The README documents external webcams and iPhone cameras via Camo; the source shows camera capture and library calls but no separate Camo integration.

Main entry points: [`main.py`](https://github.com/harsh-ongit/hill-climb-gesture-control/blob/main/main.py) (Control loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_player(("Player"))
node_runtime["Control loop<br/>[main.py]"]
node_camera["Camera"]
node_mediapipe["Hand tracker"]
node_gestures["Gesture classifier<br/>[main.py]"]
node_keyboard["Keyboard automation"]
node_game["Hill Climb Racing"]
node_preview["Video preview"]

node_player -->|"runs"| node_runtime
node_camera -->|"sends frames"| node_runtime
node_runtime -->|"processes frames"| node_mediapipe
node_mediapipe -->|"returns landmarks"| node_runtime
node_runtime -->|"counts fingers"| node_gestures
node_runtime -->|"dispatches keys"| node_keyboard
node_keyboard -->|"sends keys"| node_game
node_runtime -->|"displays frames"| node_preview
node_player -->|"views"| node_preview

click node_runtime "https://github.com/harsh-ongit/hill-climb-gesture-control/blob/main/main.py"
click node_gestures "https://github.com/harsh-ongit/hill-climb-gesture-control/blob/main/main.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_player,node_camera,node_mediapipe,node_keyboard,node_game toneIndigo
class node_runtime,node_gestures toneTeal
class node_preview toneBlue
```

## Components

### Other components

- **Player**
- [Control loop](https://github.com/harsh-ongit/hill-climb-gesture-control/blob/main/main.py): `main.py`
- **Camera**
- **Hand tracker**
- [Gesture classifier](https://github.com/harsh-ongit/hill-climb-gesture-control/blob/main/main.py): `main.py`
- **Keyboard automation**
- **Hill Climb Racing**
- **Video preview**

## Connections

- Player → Control loop: runs
- Camera → Control loop: sends frames
- Control loop → Hand tracker: processes frames
- Hand tracker → Control loop: returns landmarks
- Control loop → Gesture classifier: counts fingers
- Control loop → Keyboard automation: dispatches keys
- Keyboard automation → Hill Climb Racing: sends keys
- Control loop → Video preview: displays frames
- Player → Video preview: views
