A Python-based game collection that uses computer vision and traditional controls for gameplay.
- Platformer Game - A classic platform game with jumping and obstacles. See
PLATFORMER_README.md
for more details. - Simplified Game - A simplified version that uses basic controls
- Simple Running Game - A running game where you collect objects and avoid obstacles
- Python 3.7+
- OpenCV
- PyGame
- NumPy
- Pillow
-
Clone this repository or download the source code:
git clone https://github.com/yourusername/hand_motion_game.git cd hand_motion_game
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure you have a working webcam connected to your computer (for games that use camera input)
We welcome community testing! Here's how you can test the games:
-
Setup:
- Make sure you have Python 3.7+ installed
- Install all dependencies from requirements.txt
- Connect a webcam to your computer
-
Testing Steps:
- Run the main launcher:
python3 run_game.py
- Try each game mode
- Test with different lighting conditions
- Test with different hand positions
- Run the main launcher:
-
Reporting Issues:
- If you encounter any bugs, please open an issue with:
- Your operating system
- Python version
- Steps to reproduce
- Screenshots if possible
- If you encounter any bugs, please open an issue with:
-
Feedback:
- Share your experience
- Suggest improvements
- Report any performance issues
You can run each game individually or use the main launcher to select a game and camera:
Run the main launcher to select a game and camera:
python3 run_game.py
The launcher will:
- Let you select which game to play
- Detect available cameras on your system
- Let you choose which camera to use (useful if you have multiple cameras)
- Launch the selected game with the chosen camera
-
To run the platformer game:
python3 run_platformer_game.py
-
To run the simplified game:
python3 simplified_game.py
-
To run the simple running game:
python3 simple_running_game.py
Each game has its own specific controls. Please refer to in-game instructions or the specific game's section.
run_game.py
- Main launcher for all games with camera selectionrun_platformer_game.py
- Entry point for the platformer gameplatformer_game.py
- Core logic for the platformer gamesimplified_game.py
- The simplified game implementationsimple_running_game.py
- The simple running game implementationsimple_detection.py
- Hand detection module used by the gamesassets/
- Images and sound effects
You can add your own images to the assets/
folder:
character.png
- Main character imagebackground.png
- Game backgroundtitle_screen.png
- Title screen background- And other game-specific assets
- Ensure good lighting for better hand detection (for games that use camera)
- Position your hand clearly in view of the camera
- If experiencing lag, try reducing the window size or lowering the resolution in the game settings
- Camera not working: Make sure your webcam is properly connected and not in use by another application. Use the camera selection feature to try different cameras.
- Poor tracking: Improve lighting conditions and ensure your hand is clearly visible
- Game crashes: Check that all required dependencies are installed correctly
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a new branch for your feature
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.