Worm worms[]; int num; float wormRad; void setup() { size(400,400); num=20; wormRad=60; worms=new Worm[num]; // initialize each Worm object by // calling its constructor for(int i=0; i0; i--) ellipse(x[i],y[i], rad+radD*i,rad+radD*i); } void newPoint(float px,float py) { // check to see if the point is off-screen if(px<0) px=width; else if(px>width) px=0; if(py<0) py=height; else if(py>height) py=0; // move old values up the array for(int i=num-1; i>0; i--) { x[i]=x[i-1]; y[i]=y[i-1]; } // insert new point x[0]=px; y[0]=py; } void initMove() { if(dirD<0) dirD=random(0.25,1); else dirD=-random(0.25,1); speed=random(1,2); stateCnt=(int)random(100,200); } }