int numBalls = 10; // how many balls do we want? Ball[] myBalls = new Ball[numBalls]; // declare and assign an array of Balls // (this is basically reserves enough space // for a bunch of Balls... but doesn't really // CREATE them yet) void setup(){ frameRate(60); // 60fps size(480,360); // 640x480 window for(int i=0;iwidth || x<0){ // if this ball hits the left or right walls vX*=-1; // reverse the horizontal velocity } if(y>height || y<0){ // if this ball hits the top or bottom vY*=-1; // reverse the vertical velocity } x+=vX; // update the horizontal position based on the horizontal velocity y+=vY; // update the vertical position based on the vertical velocity drawMe(); // call this Ball's drawMe(); function (open that box) } void drawMe(){ //declare this Ball's drawMe(); function. It takes nothing, and returns nothing noStroke(); // no outline fill(myColor); // set the fill color to this Ball's myColor variable ellipse(x,y,10,10); // draw a 10x10 ellipse at coordinates x,y } };