xxxxxxxxxx
56
x1 = 50;
y1 = 70;
b1 = 70;
xoff = 0;
function setup() {
createCanvas(700, 700);
background(233, 228, 222);
noStroke();
let r3 = random(0, 700);
let r4 = random(0, 700);
let r5 = random(0, 700);
let r6 = random(0, 700);
fill(232, 14, 28);
rect(r3, r4, r5, r6);
fill(0, 100);
}
function draw() {
xoff = xoff + 0.01;
let n1 = noise(xoff) * 3;
let r1 = random(3, 6);
let r2 = random(1, 4);
ellipse(x1 + n1, y1, 2, 6);
y1 = y1 + 2;
if (y1 >= 550 + b1 + r2) {
x1 = x1 + r1;
y1 = b1 + r2;
}
if (x1 >= 650) {
noLoop();
}
}
function keyPressed() {
if (key == "1") {
y1 = 40;
b1 = 40;
x1 = x1 - (45);
}
if (key == "2") {
y1 = 70;
b1 = 70;
x1 = x1 - (45);
}
if (key == "3") {
y1 = 100;
b1 = 100;
x1 = x1 - (45);
}
}