int NUM = 400; //number of otamajakushi float[] x = new float[NUM]; //x position float[] y = new float[NUM]; //y position float[] delay = new float[NUM]; //speed float[] cntrX = new float[NUM]; //each center x float[] cntrY = new float[NUM]; //each center y float[] cLeng = new float[NUM]; float[] scl = new float[NUM]; //each scale float[] tM = new float[NUM]; //amplitude of wave float[] tLWave = new float[NUM]; //movement of wave float tL= 30; //tail length float[] radius = new float[NUM]; float[] angle = new float[NUM]; PImage ranshi; void setup(){ size(500,500); colorMode(HSB,360,100,100,100); frameRate(30); fill(200,0,100,50); smooth(); ranshi = loadImage("ranshi.png"); //enter nums to array for(int i=0; i 1) { x[i] = x[i] + dx/delay[i]; } float dy = mouseY - y[i]; if(abs(dy) > 1) { y[i] = y[i] + dy/delay[i]; } //wave of tail tLWave[i] += tM[i]/150; if (tLWave[i] > 1.0){ tLWave[i] = 0; } //draw shapes translate(x[i],y[i]); //moce center rotate(atan2(mouseY-y[i],mouseX-x[i])); scale(scl[i]); //head noStroke(); fill(200,0,100,70); ellipse(cntrX[i],cntrY[i],8,4); //tail stroke(200,0,100,70); strokeWeight(0.5); noFill(); bezier(cntrX[i]-tL, cntrY[i], cntrX[i]-tL*tLWave[i], cntrY[i]+tM[i], cntrX[i]-tL*tLWave[i], cntrY[i]-tM[i], cntrX[i]-4, cntrY[i]); popMatrix(); } //center circle /*noStroke(); fill(200,0,100,10); ellipse(mouseX,mouseY,200,200); */ imageMode(CENTER); image(ranshi,mouseX,mouseY); if(mousePressed) { for(int i=0; i