Inspiration
One of our members (Saketh) happened to have access to a webcam, and given both of our interests in computer vision, we thought about how we could modify current games' controls to work with physical features (ex. hands, parts of a face, etc.).
What it does
The game contains a spaceship whose job is to avoid asteroids coming towards it. It must either dodge the asteroids or shoot them. If the spaceship collides with an asteroid three times, the game is over. To control the spaceship, a player must stand in front of a computer camera and tilt his/her body to control the direction of the spaceship. The player also has a keypad, where he/she can click one of two buttons to fire a laser. However, there is a 2-second cooldown after three lasers are fired.
How we built it
We used the Godot game engine (the GDScript language) to create the background, object models, and animations (spaceships and asteroids). We also used GDScript for the game's logic (ex. controlling the spaceship model based on the person's position). For facial landmark detection (detecting a person's forehead), we utilized Mediapipe, which uses different models for facial detection, including Google's Gemini API.
Challenges we ran into
One of the members had to spend the first 3 hours reinstalling Python, Anaconda, VSCode, and MediaPipe onto his computer, as it was necessary to check the camera stream, which would also contain facial landmarks, for debugging purposes. Additionally, we found that we exported music and image files in the wrong format, which resulted in us replacing all .mp3 files with .wav files, and all other image files with .png files. Additionally, this was our first time using a game engine like Godot (as opposed to a library like Python's pygame).
Accomplishments that we're proud of
Given that this was one of our first experiences working with pose estimation libraries like MediaPipe, we were proud of being able to work with one of MediaPipe's models for the first time.
What we learned
We learned more about how games are designed with multiple complex components in mind---from face position tracking and translating those positions into game commands, to adding visuals/sounds.
What's next for Cowboy Crusaders
In the future, we hope to add power-ups into the game that can benefit the player (ex. no asteroids for 3 seconds). We also hope to make our method of control more robust (ex. using specific settings that can improve the landmark detection model's accuracy).
Built With
- gdscript
- godot
- mediapipe
- python
Log in or sign up for Devpost to join the conversation.