This game is an interactive maze-based game built using Python, Pygame, and MediaPipe. Control your character either with hand gestures using your webcam or with keyboard arrow keys. Collect stars, explore themed worlds, and reach the goal to win!
-
Dual Control Modes 🖐️ Hand Gesture Control: Use your index finger like a virtual joystick via your webcam 🎮 Keyboard Control: Move with arrow keys
-
Themes
-
🌳 Forest
-
🌌 Space
-
🏜️ Desert
-
🌊 Ocean
Each theme has its own color scheme and background music.
-
Action | Keyboard | Camera (Hand Gesture) |
---|---|---|
Move | Arrow Keys | Move index finger away from screen center |
Stop | — | Hold finger near center of webcam frame |
Toggle Camera | Click Camera Icon | — |
Show Help | Click Help Icon / Press SPACE | — |
Exit Game | Click Exit Icon | — |
├── main.py
├── game/
│ ├── __init__.py
│ ├── game_state.py
│ ├── maze.py
│ ├── player.py
│ ├── ui.py
│ └── game.py
├── controllers/
│ └── hand_controller.py
├── assets/
│ └── asset_manager.py
└── config.py
-
Clone the repository:
git clone https://github.com/sabihdordab/Maze-Adventure.git cd Maze-Adventure
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # or venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the game:
python main.py
Maze Adventure uses MediaPipe's hand tracking module to detect hand gestures. The center zone helps avoid accidental movement. Try experimenting with webcam position and lighting for best results.
# In mazes.txt file:
#
0, 0, 0, 0, 0, 0
0, 2, 1, 4, 1, 0
0, 1, 0, 0, 1, 0
0, 4, 1, 4, 4, 0
0, 0, 1, 0, 1, 0
0, 1, 4, 1, 3, 0
0, 0, 0, 0, 0, 0
# 0 -> wall
# 1 -> path
# 2 -> start
# 3 -> goal
# 4 -> star
THEMES["custom"] = {
"bg": (50, 50, 100),
"wall": (200, 200, 200),
"path": (100, 100, 150),
"star": (255, 255, 100)
...
}
- Level editor
- Multiplayer mode
- More themes
- Mobile version
- ...