xxxxxxxxxx
23
function setup() {
createCanvas(600, 900);
background(0);
}
function draw() {
for (let i = 0; i < 20; i++) {
noFill();
stroke(random(i*10), random(i*50), random(i*100), 10);
let y2 = i*random(height*0.04);
bezier(0, y2, width/4, 4, 3*width/4, height*0.75, width, i*random(height/2));
}
}
let lapse = 0; // mouse timer
function mousePressed(){
// prevents mouse press from registering twice
if (millis() - lapse > 400){
save('pix.jpg');
lapse = millis();
}
}