location = new PVector(width/2, height);
lastLocation = new PVector(location.x, location.y);
velocity = new PVector(0, -10);
diameter = random(10, 20);
pathfinder(pathfinder parent) {
location = parent.location.get();
lastLocation = parent.lastLocation.get();
velocity = parent.velocity.get();
diameter = parent.diameter * 0.62;
isFinished = parent.isFinished;
parent.diameter = diameter;
if(location.x > -10 & location.x < width + 10 & location.y > -10 & location.y < height + 10) {
lastLocation.set(location.x, location.y);
PVector bump = new PVector(random(-1, 1), random(-1, 1));
velocity.mult(random(5, 10));
if (random(0, 1) < 0.2) {
paths = (pathfinder[]) append(paths, new pathfinder(this));
fill(240, 230, 150, 100);
ellipse(location.x, location.y, 10, 10);
stroke(165, 42, 34, 200);
stroke(165, 42, 34, 200);
paths = new pathfinder[num];
for(int i = 0; i < num; i++) paths[i] = new pathfinder();
for (int i = 0; i < paths.length; i++) {
PVector loc = paths[i].location;
PVector lastLoc = paths[i].lastLocation;
strokeWeight(paths[i].diameter);
line(lastLoc.x, lastLoc.y, loc.x, loc.y);
paths = new pathfinder[num];
for(int i = 0; i < num; i++) paths[i] = new pathfinder();