Link: https://editor.p5js.org/Susan_Xu/sketches/7uuXIgW9m
My assignment is based on the snow animation created in class. As I watched the softy, pinky snow falling down the sky, I wanted to add more energy into this sketch. Instead of being light and gentle, these particles can also be rigid and bouncy. They should fall with gravitation, and bouncing back into broken, but also elastic pieces when they crash the ground. On thinking of this, I added gravitation in less than a minute.
The crashing pieces, though, took me more time. They should share some properties with the falling ball, but not exact. Isn’t it an great example for subclass? So I build the class SmallerParticle, inherent from Particle. In this way, I save the time and space for rewriting functions of SmallerParticle.
Keeping the interaction from the class practice, the assignment remind me of popping candy (in a more friendly way) — and it’s strawberry/grape flavor! A little animation is shown below.