• Making a Gesture-controlled 2D Car Racing game using phaser.js
• Implementing stearing control using hand gestures with help of OpenCv library of Python
• Visit our Github repo to clone and play the game.
Following Libraries must be installed.
The commands for installation are :
pip install numpy
pip install opencv-python
pip install mediapipe
pip install cvzone==1.4.1
pip install pynput
In the code there is a part to capture the live stream Videocapture(n) here the index n is by default 0 for most machines but if the webcam doesn't work with 0 you can try 1,-1,0 and so on.
Run the index.html file via livesever to play the game
Press Spacebar
to Start the game
- Control the game using arrow keys
- Add stars and enable scoring mechanism
- Avoid enemy cars
- Enable GameOver on Collision
- Add maps and audio
- Change control to awsd keys
- Run game in Loop
- map awsd keys of keyboard to screen
- enable control using awsd keys using gestures
- Align keys in proper orientation
- Link it with the game
- Enable transparency of awsd keys
racing.car.mp4
Hnads.mp4
We have mapped the controls of the car to the W,A,S,D keys on the keyboard so by using these virtual keys we can control the car . We are using Mediapipe hand detection model under hood for hand detection .