for (int i=0; i<images.length;i++){
images[i] = loadImage(""+(i+1)+".jpg");
tiles[i] = new Tile(x, y, gridSpacing, images[i], i);
x += gridSpacing;
tiles[i+images.length] = new Tile(x, y, gridSpacing, images[i], i);
x += gridSpacing;
if (x > gridWidth){
y = y + gridSpacing;
x = 0;
}
This is a for loop but do you think there is a way where you can create a class grid...where you call the grid cell and input an image.