xxxxxxxxxx
let parts;
let randomFactor=.005;
let evolve=true;//false;//
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB,360,255,255,255);
let points=[];
part=new Part(0,points,true);
parts=[part];
background(150,50,250);
}
function draw() {
background(150,50,250);
parts.forEach(function(element) {
if(element.points[0]!=undefined){
if(!evolve)element.points=JSON.parse(JSON.stringify(element.iniPoints));
element.randomize();
fill(200,150,150,80);
element.displayini();
fill(300,150,150,80);
element.display();
element.displaySym();
}
})
}
function mouseClicked(){
part.points.push(new Point(mouseX,mouseY,randomFactor));
part.iniPoints.push(new Point(mouseX,mouseY,randomFactor));
}