sketch
/*
Bon Bhakdibhumi
bbhakdib
Section D
*/
function setup() {
createCanvas(480, 480);
background(0);
frameRate(1);
}
function draw() {
noStroke();
var x = random(0, 480);
var y = random(0, 480);
// every second generate 1 random white star
fill(255);
circle(x, y, 3);
// every minute generate 1 cyan star
if(second() == 59) {
fill(0, 255, 255);
circle(x, y, 10);
}
// every hour generate 1 yellow star
if (minute() == 59 & second() == 59) {
fill(255, 255, 0);
circle(x, y, 35)
}
// when clock reaches 24 hr reset background to black
if (hour() == 23 & minute() == 59 && second() == 59) {
background(0);
}
}
For this project, I was inspired by the concept of time and the universe, which is still yet to be fully discovered or understood. In my work, a second is represented by a small “white start” appearing into the “universe.” A minute is by a “blue star”, and an hour is represented by a yellow star. When the clock reaches 24 hours, the canvas is reset to black