KJ Ha
Nature of Code: 1st Assignment
I first intended to create a random walker whose color is also constantly changing. I've used the millis() function to set an interval for the random color change as shown below.
// interval = 2 seconds
var fadeTime = millis();
if (millis() - timeOfLastSwitch > interval) {
dotColor = color(random(0, 255), random(0, 255), random(0, 255));
timeOfLastSwitch = millis();
}
To give the user more freedom, I set the mousePressed function where the user's mouse click can relocate the starting point of the random walker. The user may press the escape key to clear the canvas.