Bouncing Ball



// position of the ball
var y = 0;
// how far the ball moves every time
var speed = 10;
void draw() {
    background(127, 204, 255);
    fill(66, 66, 66);
    ellipse(200, y, 50, 50);
    if (y > 350) {
        speed = -3;
    }
    if (y < 100) {
        speed = 4;
    }
    // move the ball
    y = y + speed;
};