int ballCount = 200; float ballSize = 10; float[] xpos = new float[ballCount]; float[] ypos = new float[ballCount]; float[] radius = new float[ballCount]; float angle[] = new float[ballCount]; float ballSpeed[] = new float[ballCount]; float centerX; float centerY; void setup(){ size(700, 700); background(0); noStroke(); frameRate(30); centerX = width/2; centerY = height/2; for(int i = 0; i < ballCount; i++) { radius[i] = 1.5 * (i + 1); xpos[i] = 0; ypos[i] = 0; angle[i] = 0; ballSpeed[i] = i * (.1/ballCount); } } void draw(){ background(0); for(int i = 0; i < ballCount; i++){ ellipse(xpos[i], ypos[i], ballSize, ballSize); xpos[i] = centerX + cos(angle[i]) * radius[i]; ypos[i] = centerY + sin(angle[i]) * radius[i]; angle[i] += ballSpeed[i]; } }