0% found this document useful (0 votes)
16 views5 pages

Gesture-Controlled Gaming with Python

The document outlines several Python programs that enable gesture-controlled gameplay for popular games like Asphalt 8, Google Dino, Hill Climb Racing, Temple Run, and Subways Surfers using AI-based hand tracking and computer vision. Each program utilizes libraries such as OpenCV and MediaPipe for hand detection and gesture recognition, allowing players to control game actions through specific hand gestures. The projects aim to create a more interactive and touch-free gaming experience by mapping gestures to in-game actions.

Uploaded by

aravkumarcraft
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views5 pages

Gesture-Controlled Gaming with Python

The document outlines several Python programs that enable gesture-controlled gameplay for popular games like Asphalt 8, Google Dino, Hill Climb Racing, Temple Run, and Subways Surfers using AI-based hand tracking and computer vision. Each program utilizes libraries such as OpenCV and MediaPipe for hand detection and gesture recognition, allowing players to control game actions through specific hand gestures. The projects aim to create a more interactive and touch-free gaming experience by mapping gestures to in-game actions.

Uploaded by

aravkumarcraft
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Project Summary – Gesture-Controlled Asphalt 8: Airbone

This Python program allows the game Asphalt 8 to be controlled using hand gestures instead
of a keyboard. It uses computer vision and AI-based hand tracking for real-time gesture
recognition.

⚙ How It Works:

1. Libraries Used:
o OpenCV (cv2): Captures and displays live video from the webcam.
o MediaPipe: Detects and tracks hand landmarks (fingers, joints, and palm).
o PyAutoGUI / pyDirectInput: Simulates keyboard presses for in-game control.

2. Hand Detection:
The webcam feed is processed through MediaPipe Hands, which identifies each hand.

3. Gesture Recognition:
Based on the finger positions, the program identifies three main gestures:
o Fist – used for turning left right or braking
o Palm – used for acceleration
o Victory – used for jumping (space key)

4. Game Control Mapping:


o Both Palms → Press “W” for acceleration
o Left Fist + Right Palm → Press “A” for left turn
o Right Fist + Left Palm → Press “D” for right turn
o Both Fists → Press “S” for brake
o Any Victory Sign → Press “Space” for jump

⚙ In Short

This code combines AI hand tracking with keyboard automation to create a gesture-based
control system for gaming — turning human hand gestures directly into game actions.
Project Summary – Gesture-Controlled Google Dino

This Python program lets you play the Google Chrome Dino game using hand gestures
instead of the keyboard. It uses AI-based hand tracking to detect when a player makes a fist
and automatically makes the Dino jump.

⚙ How It Works:

1. Libraries Used:
o OpenCV (cv2): Captures real-time video from the webcam.
o MediaPipe: Detects and tracks the hand and its finger landmarks using machine
learning.
o PyAutoGUI: Simulates keyboard presses to control the game (pressing the
spacebar).

2. Hand Detection:
The webcam feed is processed through MediaPipe Hands, which detects one hand.

3. Gesture Recognition:
A custom function is_fist() checks if all fingers are folded by comparing the position
of fingertips and their joints.

4. Game Control Mapping:


o Fist → Presses “Space” key to make the Dino jump
o Open Hand → No action, Dino keeps running straight

⚙ In Short

The program combines computer vision (OpenCV) and AI gesture tracking (MediaPipe) to
let players control the Google Dino game with just hand movements, making gameplay touch-
free, interactive, and fun.
Project Summary – Gesture-Controlled Hill Climb Racing

This Python program allows players to control Hill Climb Racing using hand gestures instead
of a physical keyboard or controller. It uses AI-based hand tracking and a virtual gamepad
interface to simulate real-time driving actions like acceleration and braking.

⚙ How It Works:

1. Libraries Used:
o OpenCV (cv2): Captures and displays live video from the webcam.
o MediaPipe: Detects and tracks both hands using machine learning-based hand
landmarks.
o vgamepad: Creates a virtual Xbox controller for smooth, real-time game
control.
o PyAutoGUI: Used for pressing other keyboard keys (like Enter) when needed.

2. Hand Detection:
MediaPipe detects two hands.
Each frame is analyzed to recognize if the hand is a fist or a palm using landmark
position comparison.

3. Gesture Recognition:
o Fist: All fingers folded — represents a ―press‖ action.
o Palm: All fingers extended — represents an ―idle‖ or ―release‖ action.

1. Game Control Mapping:


o Right Fist + Left Palm → Move Right
o Left Fist + Right Palm → Move Left
o Both Fists → Move Down
o Both Palms → No Action (neutral state)
o Any Victory Sign → Press “W” for jump

⚙ In Short

This project combines MediaPipe’s AI gesture tracking, OpenCV video processing, and
vgamepad virtual controller technology to create a hands-free, gesture-controlled gaming
experience — making Hill Climb Racing more interactive and futuristic.
Project Summary – Gesture-Controlled Temple Run

This Python program allows players to control Temple Run using hand gestures instead of a
physical keyboard or controller. It uses AI-based hand tracking and a virtual gamepad
interface to simulate real-time running actions like jumping, sliding, and turning.

⚙ How It Works:

2. Libraries Used:
o OpenCV (cv2): Captures and displays live video from the webcam.
o MediaPipe: Detects and tracks both hands using machine learning-based hand
landmarks.
o vgamepad: Creates a virtual Xbox controller for smooth, real-time game
control.
o PyAutoGUI: Used for pressing other keyboard keys (like Enter) when needed.

3. Hand Detection:
MediaPipe detects two hands.
Each frame is analyzed to recognize if the hand is a fist or a palm using landmark
position comparison.

4. Gesture Recognition:
o Fist: All fingers folded — represents a ―press‖ action.
o Palm: All fingers extended — represents an ―idle‖ or ―release‖ action.

5. Game Control Mapping:


o Right Fist + Left Palm → Move Right
o Left Fist + Right Palm → Move Left
o Both Fists → Move Down
o Both Palms → No Action (neutral state)
o Any Victory Sign → Press “W” for jump

⚙ In Short

This project combines MediaPipe’s AI gesture tracking, OpenCV video processing, and
vgamepad virtual controller technology to create a hands-free, gesture-controlled gaming
experience — making Temple Run more interactive and futuristic.
Project Summary – Gesture-Controlled Subways Surfers

This Python program allows players to control Subways Surfers using hand gestures instead
of a physical keyboard or controller. It uses AI-based hand tracking and a virtual gamepad
interface to simulate real-time running actions like jumping, sliding, and turning.

⚙ How It Works:

1. Libraries Used:
o OpenCV (cv2): Captures and displays live video from the webcam.
o MediaPipe: Detects and tracks both hands using machine learning-based hand
landmarks.
o vgamepad: Creates a virtual Xbox controller for smooth, real-time game
control.
o PyAutoGUI: Used for pressing other keyboard keys (like Enter) when needed.

2. Hand Detection:
MediaPipe detects two hands.
Each frame is analyzed to recognize if the hand is a fist or a palm using landmark
position comparison.

3. Gesture Recognition:
o Fist: All fingers folded — represents a ―press‖ action.
o Palm: All fingers extended — represents an ―idle‖ or ―release‖ action.

4. Game Control Mapping:


o Right Fist + Left Palm → Move Right
o Left Fist + Right Palm → Move Left
o Both Fists → Move Down
o Both Palms → No Action (neutral state)
o Any Victory Sign → Press “W” for jump

⚙ In Short

This project combines MediaPipe’s AI gesture tracking, OpenCV video processing, and vgamepad
virtual controller technology to create a hands-free, gesture-controlled gaming experience — making
Subways Surfers more interactive and futuristic.

You might also like