Control Subway Surfers using hand gestures via webcam โ no touch or keyboard required.
Built using MediaPipe, OpenCV, and Python for real-time hand tracking and gesture-based input.
- โ Real-time hand gesture recognition
- ๐ฏ Accurate finger pattern detection
- โจ๏ธ Simulates arrow key presses (
up,down,left,right) - ๐ง Compatible with GameLoop emulator version of Subway Surfers
- โก Fast response with minimal lag
- ๐ก On-screen feedback with gesture labels
| Hand Gesture | Game Action | Visual Feedback |
|---|---|---|
| โ๏ธ Index finger up | Jump | ๐ข Jump |
| โ๏ธ Index + Middle fingers | Roll | ๐ต Roll |
| ๐ค Index + Middle + Ring | Move Right | ๐ก Right |
| ๐ All four fingers (except thumb) | Move Left | ๐ Left |
- MediaPipe โ hand tracking
- OpenCV โ camera input + drawing
- keyboard โ simulate keystrokes
- Python 3.x
- Clone the repo
git clone https://github.com/SahajDang/gesture-control-subway-surfers.git
cd gesture-control-subway-surfers- Install dependencies
pip install opencv-python mediapipe keyboard
- Run the script
Make sure to run as Administrator (important for key simulation)
python gesture_controller.py
- Start the game
-
Launch Subway Surfers in GameLoop or any emulator that supports arrow key input.
-
Focus the game window and control the player using hand gestures!
-
The script must be run with admin privileges so that simulated keystrokes reach the game.
-
The game window (GameLoop) must be focused to receive input.
-
For smoother detection, use gestures in a well-lit environment and keep your hand within the frame.
MIT License ยฉ 2025 Sahaj Dang