< Go Back Home

Catch the Confetti - Vanilla JS Game

✨CATCH ME IF YOU CAN✨

Today is Day 10 of #100DaysofCode, and I’ve just finished building another (much more complex!) little game in JavaScript! See how fast you are in “catching” (clicking) the confetti all over the screen. Best enjoyed on desktop ? You can check it out (and all of the corresponding code!) on my codepen. ?
.
So what’s going on here under the hood? We’re running a few JavaScript functions here. We’re:
⏰ Displaying your reaction time,
⌚️Randomly changing how fast a new confetti will pop up (between 0 and 2 seconds),
? Randomly assigning new colors, height, width, and positioning to the confetti,
? And of course looping that to repeat so you don’t have to stop playing after one trial. ?

Play along at https://codepen.io/chloecodes/full/BaBqovb

Coded by Chloe on May 1st, 2024