class BlobBall extends Ball { //---------------------------- // variables int numBlobPts = 30; //---------------------------- void draw() { // draw curves in a circle around the center stroke(#FF0000); strokeWeight(2); fill(#E34040); beginShape(); for (int i=0; i < numBlobPts+3; i += 1) { float offsetX = ballRadius*0.5*(noise(frameCount/10.0, i%numBlobPts)+1.5)*cos(2*PI*i/numBlobPts); float offsetY = ballRadius*0.5*(noise(frameCount/10.0, i%numBlobPts)+1.5)*sin(2*PI*i/numBlobPts); curveVertex(centerX + offsetX, centerY + offsetY); } endShape(); strokeWeight(1); // draw some eyes, looking at the closest target stroke(0); if ((centerX - eyeOffsetX) < width/2) drawLeftEye(width/4, height/2); else drawLeftEye(width*3/4, height/2); if ((centerX + eyeOffsetX) < width/2) drawRightEye(width/4, height/2); else drawRightEye(width*3/4, height/2); } }