xxxxxxxxxx
var x = 0;
var x2 = 50;
var counter = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
counter++
background(0);
createLine();
createLine2();
}
function createLine() {
stroke(255,0,0);
line(x,0,0,x);
x += 5;
if (x-(windowWidth/2) > windowWidth) {
x = 0;
}
}
function createLine2() {
stroke(255,0,0);
line(x2,0,0,x2);
x2 += 5;
if (x2-(windowWidth/2) > windowWidth) {
x2 = 50;
}
}