# remikjj/tetris_gesture architecture

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

- Interactive diagram: https://gitdiagram.com/remikjj/tetris_gesture
- Repository: https://github.com/remikjj/tetris_gesture

## Overview

##### Project type and purpose
- This is a single‐machine Python desktop application (“Gesture control for tetris game (PyGame)”).
- It combines real-time camera input (gesture recognition) with a classic Tetris game engine drawn via PyGame.

##### File structure
- .gitignore: standard VCS exclusions.
- README.md: one‐line description.
- requirements.txt: lists Python dependencies (PyGame, OpenCV, Mediapipe or similar).
- gesture.py: module that captures camera frames, detects gestures, and emits control signals (left, right, rotate, drop).
- main.py: application entry point, hosts the game loop, imports gesture module, updates Tetris state, and renders via PyGame.

##### README for additional insights
- Project relies on PyGame for rendering and a vision library for gesture input.

## Diagram (Mermaid)

```mermaid
flowchart TB
    Camera["Camera (Webcam)"]:::input
    VisionLib["Vision Library\n(OpenCV/Mediapipe)"]:::external

    subgraph "Python Process"
        direction TB
        Gesture["Gesture Recognition\n(gesture.py)"]:::processing
        Engine["Tetris Engine\n(main.py)"]:::processing
        Renderer["PyGame Renderer\n(main.py)"]:::output
    end

    Display["User Screen"]:::output

    Config["Configuration & Dependencies\n(requirements.txt)"]:::config
    Docs["Documentation\n(README.md)"]:::config
    VCS["VCS Exclusions\n(.gitignore)"]:::config

    Camera -->|Video Frames| VisionLib
    VisionLib -->|Frames| Gesture
    Gesture -->|Control Commands| Engine
    Engine -->|Render Calls| Renderer
    Renderer -->|Display Output| Display

    Engine -->|loads| Config
    Engine -->|reads| Docs
    Engine -->|ignores| VCS

    click Gesture "https://github.com/remikjj/tetris_gesture/blob/main/gesture.py"
    click Engine "https://github.com/remikjj/tetris_gesture/blob/main/main.py"
    click Renderer "https://github.com/remikjj/tetris_gesture/blob/main/main.py"
    click Config "https://github.com/remikjj/tetris_gesture/blob/main/requirements.txt"
    click Docs "https://github.com/remikjj/tetris_gesture/blob/main/README.md"
    click VCS "https://github.com/remikjj/tetris_gesture/blob/main/.gitignore"

    classDef input fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef external fill:#B0C4DE,stroke:#000,stroke-width:1px;
    classDef processing fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef output fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
