Links
Inspiration
Our inspiration for this project comes from a grade 10 computer science class that we both attended. In that class we created a breakout game through code.org and block code JavaScript. Thus, we thought a good starting starting point would be breakout. Furthermore, we also were interested in computer vision due to exhibit at a science fair we both attended using computer vision for hand detection. That caused us to try and combine the two to create a game that would be achievable for us to complete during this hackathon.
What it Does
BreakoutX is a game of breakout that incorporates computer vision to control the paddle. This game allows the user to use their hand as the controller.
How We Built It
We started building this by splitting up the work. One partner focused majority of their time looking into computer vision in python with a use of OpenCV. The other partner spent their time mostly on the game development. However, we all helped each other when stuck. The game is built using Pygame and sprites are generated via the creation of rectangles and circles. The use of OpenCV allowed for us to track hand movements and relate it to the x position of the paddle. We also used resources such as Youtube and webpage tutorials to guide us when we were confused.
Challenges We Ran Into
A major hurdle that we ran into was the use of computer vision and how it should be implemented into the game of breakout. One of the first ideas was to have box areas in the camera viewer and when the user has an object or a hand in the box a corresponding left or right key is pressed. However, this had a myriad of faults when trying to detect the hand or object. Thus, we decided to use hand-tracking for the movement of the paddle.
Accomplishments That We're Proud Of
We are very proud of having running pong game with computer vision. We are especially proud that we managed to use and learn some python and computer vision without much prior knowledge of the language and field.
What We Learned
We learned how to use Pygame, OpenCV, and parts of the python language. The use of python allowed us to consolidate a further understanding of functions and methods. In addition, we learned how computer vision could be effective in many ways.
What's Next?
We hope to incorporate computer vision with python into our daily lives. For example, a light switch dimmer controlled by our hands before sleeping. In addition, we want to become better at python development and maybe even create our own machine learning algorithm like OpenCV.