xxxxxxxxxx
xPos = 400
speed = 2
function setup() {
createCanvas(1200, 900);
}
function draw() {
//background is redder depending on the hour
background(hour() * 10, 168, 239);
ellipse(xPos, 200, 100);
if(xPos > 800 || xPos < 400){
speed *= -1;}
ellipse(xPos, 400, 100);
ellipse(xPos, 900, 100);
xPos = xPos + speed;
fill(map(second(), 0, 59, 0, 255), map(minute(), 0, 59, 0, 255), map(hour(), 0, 59, 0, 255))
rect(map(hour(), 0, 23, 0, width), 100, second(), minute());
trinity(100);
trinity(200);
trinity(300);
trinity(400);
}
function trinity (x) {
line(200, 600, width-200, height-600);
}