xxxxxxxxxx
25
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
if (mouseX < width / 2) {
drawRects();
} else {
drawLines();
}
}
function drawLines() {
line(0, 0, width, height);
line(-10, 0, width - 10, height);
line(10, 0, width + 10, height);
}
function drawRects() {
rect(random(8, 12), 10, 50, 50);
rect(340, 340, 50, 50);
}