Skip to content

About

Control Subway Surfers using real-time hand gesture tracking powered by OpenCV, MediaPipe, and Python.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Subway Surf with Python - Hand Tracking Game Control

Language Computer Vision ML Framework Automation License

Welcome to Subway Surf with Python! An interactive Computer Vision application that lets you play Subway Surfers using physical hand gestures in real-time. Built using OpenCV, MediaPipe, and AI-assisted gesture mapping algorithms to replace traditional keyboard controls with natural hand movements.


✨ Key Features

  • 🖐️ Real-Time Hand Landmark Detection: Tracks 21 hand knuckles with high precision using MediaPipe.
  • 🕹️ Dynamic Gesture Mapping: Maps physical hand positions (jump, crouch/roll, lane shift left, lane shift right) directly to virtual keyboard inputs.
  • ⚡ Low-Latency Game Control: Optimized frame processing loop to ensure instant response time during gameplay.
  • 🎥 Live Camera Overlay: Visual feedback showing tracked landmarks and current gesture state directly on the screen.
  • 🤖 AI-Enhanced Architecture: Built with AI assistance to refine distance calculations and gesture recognition accuracy.

🛠️ Tech Stack & Tools

  • Language: Python 3.x
  • Computer Vision: OpenCV (cv2)
  • Gesture Tracking: MediaPipe Hands
  • Keyboard Automation: PyAutoGUI
  • Mathematical Operations: NumPy

🚀 Getting Started

Follow these steps to set up and run the project locally on your machine.

Prerequisites

Make sure you have installed:

  • Python >= 3.8
  • pip (Python Package Installer)
  • A working Webcam

Installation & Execution

  1. Clone the repository:

    git clone https://github.com/Madtch/subwaysurfwithpython.git
    cd subwaysurfwithpython
  2. Set up a Virtual Environment (Optional but recommended):

    python -m venv venv
    # On Windows:
    venv\Scripts\activate
    # On macOS/Linux:
    source venv/bin/activate
  3. Install Dependencies:

    pip install opencv-python mediapipe pyautogui numpy
  4. Run the Application:

    python subwaysurf.py
  5. Start Playing:

    • Open Subway Surfers (via Web Browser or Emulator).
    • Ensure your webcam captures your hand clearly.
    • Move your hands to trigger in-game movements!

👤 Author

Zamzami Ahmad


Developed with modern Computer Vision standards to showcase real-time gesture recognition and Human-Computer Interaction (HCI).

About

Control Subway Surfers using real-time hand gesture tracking powered by OpenCV, MediaPipe, and Python.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages