xxxxxxxxxx
35
function setup() {
createCanvas(600, 400);
background(220);
pointX = random(width/2-100,width/2+100);
pointY = random(height/2-100,height/2+100);
numberOfPoints = 2;
rand = random(-1.5,0.5);
frameRate(30);
}
function draw() {
// background(220);
strokeWeight(1);
// stroke(random(255), random(255), random(255));
for(var j=0; j<height; j+=height/numberOfPoints){
stroke(random(255), random(255), random(255),50);
line((j*rand)+pointX, (j*rand)+pointY, mouseX, mouseY);
strokeWeight(2);
stroke(5,255);
line(mouseX, mouseY, pmouseX, pmouseY);
}
// print(pointX, pointY);
}
function mousePressed(){
background(220);
pointX = random(width/2-100,width/2+100);
pointY = random(height/2-100,height/2+100);
}