Lab 02 — Interactive Drawing
Creating interactive visuals with p5.js.
Notes
I made the circle go along the X-axis and bounce back when it hits the edge of the canvas. The circle's Y position is controlled by the mouse's Y position. I also added a feature where the circle changes color every second to a random color. Circle radius increases according to its distance to the edges of the canvas, in a square ratio. Additionally, when mouse is pressed, the travel direction of the circle is reversed. I also added a vertical line to visualize the movement. Background refreshes gradually to create a fading effect.