int space=10; // amount of space around objects myObj[][]objArray; // container for objects void setup(){ size(200,200); background(255); colorMode(RGB, 100); } void draw(){ objArray=new myObj[400][400]; // set array for (int x=0; x<20; x++){ for (int y=0; y<20; y++){ fill(y*12,x*12,0); objArray[x][y]=new myObj((x*space), (y*space)+1); } } } class myObj{ myObj(int x, int y){ rect(x, y, 8, 8); } }