class Movel{ public float angle, radius; float sa, sr; color c; public Movel(){ angle = random(TWO_PI); radius = random(1.0); sa = random(-PI,PI); sr = random(-0.5,0.5); c = color((int)random(256), (int) random(128,255),(int) random(128,255)); } public void draw(){ float x = (cos(angle) * radius * halfwidth) + halfwidth; float y = (sin(angle) * radius * halfheight) + halfheight; fill(c); ellipse (x,y,10,10); } public void move(){ angle += (sa / 30); radius += (sr / 30); // test boundaries if ((1-radius)<= epsilon){ if (sr>=0){ sr = random(-0.5,-epsilon); sa = random(-PI,PI); highlights.add(new Highlight(angle,false)); } } else{ if (radius <= epsilon){ if (sr<=0){ sr = -sr; c = color((int)random(256), (int) random(128,255),(int) random(128,255)); highlights.add(new Highlight(angle,true)); } } } } }