https://github.com/mohammed-helal/pingpongpy
Ping Pong Game with Hand Tracking 🎮✋ A fun and interactive Ping Pong game built with Python, OpenCV, and CvZone! Control the paddles using real-time hand tracking, challenge a friend, and see who reaches 5 points first. Easy to set up and play! 🚀
https://github.com/mohammed-helal/pingpongpy
computer-vision hand-gesture-recognition hand-tracking opencv ping-pong-game pygame python
Last synced: 2 months ago
JSON representation
Ping Pong Game with Hand Tracking 🎮✋ A fun and interactive Ping Pong game built with Python, OpenCV, and CvZone! Control the paddles using real-time hand tracking, challenge a friend, and see who reaches 5 points first. Easy to set up and play! 🚀
- Host: GitHub
- URL: https://github.com/mohammed-helal/pingpongpy
- Owner: Mohammed-Helal
- Created: 2024-12-15T10:03:24.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-19T05:54:51.000Z (10 months ago)
- Last Synced: 2025-04-09T00:07:16.733Z (6 months ago)
- Topics: computer-vision, hand-gesture-recognition, hand-tracking, opencv, ping-pong-game, pygame, python
- Language: Python
- Homepage:
- Size: 11.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ping Pong Game with Hand Tracking 🎮✋
A fun and interactive Ping Pong game built with Python, OpenCV, and CvZone! Control the paddles using real-time hand tracking, challenge a friend, and see who reaches 5 points first. 🚀
## Project Team
- Ahmed Mosaad
- Ahmed Shaheen
- Mohammed Helal
- Islam Mohammed## Features
- Real-time hand tracking for paddle control.
- Dynamic ball physics for an exciting experience.
- Score tracking and game-over screen.## How to Play
1. Clone this repository:
git clone https://github.com/Mohammed-Helal/PingPongPY.git2. Install dependencies:
pip install -r requirements.txt3. Run the game:
python main.py4. Use your left and right hands to control the paddles and bounce the ball.
## Assets
Place all required images in the `Resources/` folder:
- `Background.png`: The background of the game.
- `gameOver.png`: The game-over screen.
- `Ball.png`: The ball image.
- `bat1.png` and `bat2.png`: Paddle images for Player 1 and Player 2.## Controlling Speed
You can control the speed of the object in the game by modifying the `speedX` and `speedY` variables in the code. These variables represent the movement speed of the object in the horizontal and vertical directions, respectively.- **`speedX`**: Controls the speed of the object in the horizontal (X) direction.
- **`speedY`**: Controls the speed of the object in the vertical (Y) direction.By changing the values of `speedX` and `speedY`, you can adjust the speed of the object's movement, allowing for customized gameplay.
Example:
```c
int speedX = 20; // Speed in the horizontal direction
int speedY = 30; // Speed in the vertical direction
```## Controls
- Press `R` to restart the game.
- The first player to reach 5 points wins!## Requirements
- Python
- OpenCV
- CvZone
- NumPy