xxxxxxxxxx
31
let x = 0;
let bounce = 6;
let bounceAgain = 15
let y = 0;
function setup() {
createCanvas(500, 500);
//colorMode(HSB);
frameRate(25);
//background(225);
}
function draw() {
x = x + bounce;
if (x >= width || x < 0) {
bounce = bounce * -1;
}
y = y + bounceAgain;
if (y >= height || y < 0) {
bounceAgain = bounceAgain * -1;
}
fill(20, 40, 120);
stroke(195);
strokeWeight(3);
rect(x, y, random(90, 180), random(90, 180));
}