xxxxxxxxxx
28
let x, y, velocity, rad;
function setup() {
createCanvas(windowWidth, windowHeight);
x = width/2;
y = 0;
rad = 25;
velocity = 1;
}
function draw() {
background(245, 245,255);
fill(0, 0, 255);
noStroke();
ellipse(x, y, rad*2, rad*2);
y = y + velocity;
velocity += 0.2;
if ((y + rad) >= height) {
y = 0-rad;
}
if (y < 0) {
velocity = 1;
}
}