class Droplet extends PPCircle { Color C = new Color(100,100,255); color c = color(100,100,255); int soundDelay; int TAILSIZE=12; float oldX[] = new float[TAILSIZE]; float oldY[] = new float[TAILSIZE]; Droplet(float x, float y){ super(10); setPosition(x+random(-1,1),y+random(-1,1)); setVelocity(random(-1,1),random(20,40)); setStrokeWidth(0); setFillColor(C); setStrokeColor(C); setRestitution(0.5); setDrawable(false); for(int i = 0; i < TAILSIZE;i++){ oldX[i]= x; oldY[i]= y; } } void doTail(){ if (soundDelay > 0) soundDelay--; for(int i = 0; i < TAILSIZE-1;i++){ oldX[i]= oldX[i+1]; oldY[i]= oldY[i+1]; } oldX[TAILSIZE-1] = getX(); oldY[TAILSIZE-1] = getY(); stroke(c); for(int i = 0; i < TAILSIZE-1;i++){ strokeWeight(i); line( oldX[i],oldY[i], oldX[i+1],oldY[i+1]); } fill(c); strokeWeight(0); ellipse(getX(),getY(),getSize()/2,getSize()/2); stroke(200,200,255); strokeWeight(2); line(getX()-getSize()/6,getY()-getSize()/6,getX()-getSize()/5,getY()-getSize()/5); } // }