class flotsam extends creature { mass body[]; mass center; float s; float press; float sinWave; boolean ccw; flotsam(penStroke ps) { type=10; ps.statistics(); press=ps.totalPress/ps.totalLength/2000; if(ps.points.length<=1) { killed=true; return; } s=constrain(ps.totalLength/800,0.02,2); body=bodyShape(ps); center=new mass(centerOfMass(body)); for(int i=0;i(85+(this.s*7)+body.length/100)) body[i].connectSpringTo(body[s],.1); } } for(int i=1;i0) line(body[i].p,body[i-1].p); } */ // stroke(220,0,0); // ellipse(intersect,12); /* code to test intersection process stroke(120); for(int i=0;i0) // line(total[i].p,total[i-1].p); }*/ } } /*class flora extends creature { mass center; mass tail[]; mass body[]; mass root; boolean useTail=false; float s; float floraSize; float floraColor; float averageLength; float heading=0; int ip; penStroke floraStroke; flora child[]; flora(penStroke ps) { type=10; s=ps.totalLength/1000; floraSize=1; floraColor=1; penStroke dt=simplify(ps); floraStroke=dt; int intersectAt=findIntersection(dt); ip=intersectAt; ip=constrain(ip,0,ip); int diff=dt.points.length-intersectAt; body=new mass[diff-2]; for(int i=0;i