Lab 02 — Make the ball yours
The sketch displays a circle changing its shape, size and color
Sketch
Notes
The ball initially moves across the canvas, dynamically scaling its size and shifting colors between blue and white depending on which half of the screen it occupies.
This sketch also introduces custom interactivity through the following controls:
- Mouse Click: Randomizes the ball's color theme, instantly reverses its movement direction, and flips its scaling behavior (shrinking vs. growing).
- Spacebar: Toggles a complete pause on all operations. When paused, the ball freezes in place and ignores all mouse inputs. Pressing the spacebar a second time resumes the interactive simulation.