An open API service indexing awesome lists of open source software.

https://github.com/rajsinha7/gesture-controlled-crocodile-game

This is a fun arcade-style game where a cartoon crocodile moves left and right at the bottom of the screen, avoiding falling obstacles (red boxes) from the top. The game is controlled using real-time hand gestures captured via webcam using OpenCV and MediaPipe and the Game engine via pygame.
https://github.com/rajsinha7/gesture-controlled-crocodile-game

mediapipe opencv pygame-library python

Last synced: about 2 months ago
JSON representation

This is a fun arcade-style game where a cartoon crocodile moves left and right at the bottom of the screen, avoiding falling obstacles (red boxes) from the top. The game is controlled using real-time hand gestures captured via webcam using OpenCV and MediaPipe and the Game engine via pygame.

Awesome Lists containing this project

README

          

# Gesture-controlled-Crocodile-Game
The Gesture Controlled Crocodile Game is a fun arcade-style game developed using Python, where a cartoon crocodile moves left and right at the bottom of the screen to avoid falling obstacles.
The game is controlled using real-time hand gestures captured via a webcam using OpenCV and MediaPipe Hands, while the game logic and rendering are handled using Pygame.

This project demonstrates the integration of computer vision, gesture recognition, and game development.

--> Game Features:
-Gesture Control
Uses the index finger position to move the crocodile left or right
- Real-Time Camera Feed
Webcam input processed live using MediaPipe Hands
- Animated Crocodile
Simple 3-frame tail animation
- Falling Obstacles
Red boxes fall from random horizontal positions
- Collision Detection
Game ends if the crocodile touches an obstacle
- Scoring System
Score increases as long as the player survives
- Pause & Restart Controls
-Press P to pause

-ress R to restart after Game Over

---> Tech Stack
Component Library / Tool Purpose
Language Python Main programming language
Game Engine Pygame Rendering graphics & game loop
Camera Input OpenCV (cv2) Access webcam feed
Hand Tracking MediaPipe Hands Real-time finger tracking
Parallel Processing Python Threading Run camera detection alongside game
--> Project Structure
Gesture-controlled-Crocodile-Game/

├── hand-gesture-game-controller/
│ ├── game.py
│ ├── hand_tracking.py
│ ├── assets/
│ │ └── images/
│ └── utils.py
└── README.md

--> How to Run the Project
1️.Prerequisites
Python 3.x installed
A working webcam

2️. Install Dependencies
pip install pygame opencv-python mediapipe numpy

3️. Clone the Repository
git clone https://github.com/Rajsinha7/Gesture-controlled-Crocodile-Game.git
cd Gesture-controlled-Crocodile-Game
4️. Run the Game
python game.py
--> How It Works
Webcam captures live video feed
MediaPipe Hands detects hand landmarks
Index finger position is tracked
Finger movement controls crocodile movement
Pygame renders graphics and handles collisions

Score updates in real time