MyShape[] shape = new MyShape[12*12]; void setup(){ size(350,350); //make the screen big enough to see for(int y=0; y<12; y++){ //for 12 steps in y for(int x=0; x<12; x++){ //for 12 steps in x //make a shape (calling the polygon constructor) shape[y*12+x] = new MyShape(5, 10.,x*20., y*20.); shape[y*12+x].move(10.*x, 10.*y); } } } void draw(){ for(int y=0; y<12; y++){ //for 12 steps in y for(int x=0; x<12; x++){ //for 12 steps in x shape[y*12+x].plot(); // plot the shapes } } }