top of page
< Back

Beat Tapper
(15-112 Fundamentals of Programming)

Beat Tapper is a rhythm game that uses the player's webcam, where the player must use their pointer finger to tap circles on the screen which subsequently burst into color explosions. The project was created purely in Python and utilized a webcam module called OpenCV along with a machine learning module and complex 2D physics. It placed in the top 10 among hundreds of students in the class. 


1. Finger Tracking

Finger tracking combines a machine learning module called media pipe (MP) with a webcam module called OpenCV. MP has a collection of ~30,000 images of hands and uses machine learning to analyze these images so that Python can determine what a hand is

Hands have 20 different landmarks to help determine shape and structure. My program takes the 8th landmark, the tip of the index finger, and converts it into coordinates that I can use on my OpenCV screen. Once the fingertip is in a circle, that circle “bursts” and points are given to the player.

2. Color Bursting

The color bursting effect utilizes Object-Oriented Programming, where each "particle" that explodes out of the original circle is its own individual object. Whenever a circle is successfully tapped, a random amount of particles are appended to a list containing the particle objects, with their initial x and y coordinates being the center of the circle that was tapped. Each explosion also follows its own respective color scheme to make the explosion aesthetically pleasing. Using vector and physics calculations, force is applied to each particle’s x and y vectors based on a blast force, blast radius, and pseudo-gravity to imitate gravitational acceleration. This gives a “burst” visual effect where particles are going in random directions around the circle at different speeds.

The entire codebase to the project can be found here:

bottom of page