xxxxxxxxxx
31
let x, y;
function setup() {
createCanvas(720, 400);
// Starts in the middle
x = width / 2;
y = height;
textSize(30);
textAlign(CENTER);
}
function draw() {
background(200);
// Draw a circle
stroke(50);
fill(100);
ellipse(x, y, 24, 24);
// Moving up at a constant speed
y = y - 1;
// Reset to the bottom
if (y < 0) {
y = height;
}
text(frameCount, (width / 2) - 50, height / 2);
}