A Pygame project where you control a spaceship with your hands using a webcam!
Move your ship with your left hand and shoot by opening your right hand.
your_project/
├── assets/
│ ├── ...
├── sprites/
│ ├── __init__.py
│ ├── asteroid.py
│ ├── bullet.py
│ ├── explosion.py
│ └── spaceship.py
├── helpers.py
├── main.py
├── menu_scene.py
├── tracking.py
├── waveManager.py
└── requirements.txt # (see below)
Install Python 3.11 or later.
You need the following Python libraries:
- pygame
- opencv-python
- mediapipe
Install them all at once by running:
pip install -r requirements.txt- Make sure your webcam is connected and working.
- Open a terminal or command prompt in the project folder.
- Run:
python main.py-
When the menu appears:
- Place your left and right hands on the green circles to start the game!
-
In-game:
- Move your left hand to steer the ship.
- Open your right hand to shoot.
-
If you lose all health, press R to restart!
When launching for the first time, your system may ask for webcam permissions.
Make sure to allow it, otherwise the game won't detect your hands.
- Assets (
/assetsfolder) must be placed correctly, otherwise images won't load! - If you get an error about missing DLLs (MediaPipe-related), make sure you installed everything via
pip install -r requirements.txt. - Tested on Windows 10 and Python 3.11.
Enjoy flying through space with your hands! 🚀🖐️