Skip to content

SahajDang/gesture-control-subway-surfers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•น๏ธ Gesture-Controlled Subway Surfers

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.


๐ŸŽฎ Features

  • โœ‹ 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

โœ‹ Gesture Mappings

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

๐Ÿง  Tech Stack

  • MediaPipe โ€“ hand tracking
  • OpenCV โ€“ camera input + drawing
  • keyboard โ€“ simulate keystrokes
  • Python 3.x

๐Ÿš€ How to Run

  1. Clone the repo
git clone https://github.com/SahajDang/gesture-control-subway-surfers.git
cd gesture-control-subway-surfers
  1. Install dependencies
pip install opencv-python mediapipe keyboard
  1. Run the script

Make sure to run as Administrator (important for key simulation)

python gesture_controller.py
  1. 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!

๐Ÿ“Œ Notes

  • 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.

๐Ÿ“„ License

MIT License ยฉ 2025 Sahaj Dang

About

Control Subway Surfers using hand gestures with Python + MediaPipe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages