xxxxxxxxxx
36
function setup() {
createCanvas(400, 400);
frameRate(2);
}
function draw() {
background(220);
for(let i = 0; i < 20; i++) {
let x1 = random(100, 300);
let y1 = random(100, 300);
let x2 = random(100, 300);
let y2 = random(100, 300);
strokeWeight(2);
line(x1, y1, x1, y2);
x1 = random(100, 300);
y1 = random(100, 300);
x2 = random(100, 300);
y2 = random(100, 300);
line(x1, y1, x2, y1);
}
}
function mousePressed() {
noLoop();
}
function mouseReleased() {
loop();
}