xxxxxxxxxx
36
let i = 0;
let continued = false;
let offset = 0;
const incrementSpeed = 50;
function setup() {
createCanvas(400, 400);
// frameRate(120);
background(220)
}
function draw() {
// background(220);
if (i > width && continued == false) {
continued = true;
i = 0;
i = offset;
line(0,height-i,width,i);
offset++;
return;
} else if (i > height && continued == true) {
continued = false;
i = offset;
offset++;
}
if (!continued) {
line(i,0,width-i,height);
i += incrementSpeed;
} else {
line(0,height-i,width,i);
i += incrementSpeed;
}
}