xxxxxxxxxx
56
let canvas;
// let xa;
// let xb;
// let ya;
// let yb;
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
function setup() {
canvas = createCanvas(windowWidth, windowHeight);
canvas.position(0, 0);
//canvas.style('z-index','-1');
for(i=0; i<500; i++){
xa=random(windowWidth);
console.log(xa);
ya=random(15000);
xb=xa-random(-20,20);
yb=ya-random(-20,20);
line(xa,ya,xb,yb);
push();
stroke(255, 128, 128);
circle(xa+random(-100,100),ya+random(-100,100),random(10));
pop();
}
}
function keyPressed() {
clear();
for(i=0; i<500; i++){
xa=random(windowWidth);
ya=random(15000);
xb=xa-random(-20,20);
yb=ya-random(-20,20);
line(xa,ya,xb,yb);
push();
stroke(255, 128, 128);
circle(xa+random(-100,100),ya+random(-100,100),random(10));
pop();
}
}
function draw() {
if (mouseIsPressed) {
line(pmouseX, pmouseY, mouseX, mouseY);
}
}