Assignment 2 — Star Catcher
Catch as many falling stars as you can in 30 seconds, using your finger. Just don't touch the dying ones.
How to Play
Allow camera access, click once to turn on sound, and hold one hand up where the webcam can see it. Your index fingertip is tracked with ml5.js handPose, so touch the big star to start. After a short countdown, stars fall for 30 seconds. Catch a gold star with your fingertip for 1 point, but a dark red dying star takes 5 away. Every 10 seconds you go up a level, and the stars fall faster with more dying ones mixed in. You win by beating your high score. Catch more dying stars than gold ones and your score goes negative, and the game honours your sympathy for the dying.
Notes
I wanted a simple game where you reach around the screen and the camera is the controller. The dying stars make you stop and choose instead of swiping at everything. The hardest part was the camera. The fingertip position jumped around, so the finger is smoothed with lerp() and the stars are easier to catch than they look. The fingertip was also mirrored twice for a while, so the dot landed on the wrong finger.
View the Codebase