xxxxxxxxxx
43
function setup() {
createCanvas(800, 800);
background(245, 243, 240);
x = random(100, 300);
hR = random(300, 500);
xR = random(500, 700);
yS = 200;
y = yS;
yR = random(0.1, 0.4);
rR = random(0, 255);
rG = random(0, 255);
rB = random(0, 255);
}
function draw() {
if (x < 200 || x > 600 || y < 200 || y > 600) {
stroke(245, 243, 240);
} else {
stroke(rR, rG, rB);
}
ellipse(x, y, 1);
x = x + 1;
if (x < hR) {
y = y - yR;
}
if (x > hR) {
y = y + yR;
}
if (x > xR) {
x = random(100, 300);
yS = yS + 5;
y = yS;
xR = random(500, 700);
rR = random(0, 255);
rG = random(0, 255);
rB = random(0, 255);
}
}