I'm trying make a 2 dimensional array. An array of object. I'm trying to make a 126 by 94 array of green SpotInField objects.
import javax.swing.*;
class FarmField {
public static void main(String[] args) {
int width = 126;
int length = 94;
}
public void FarmField(SpotInField myField[][], int dwell){
int displayDurationInSeconds = 5;
myField = new SpotInField[126][94];
for (int i=0; i<myField.length; i++) {
for (int j=0; j<myField[i].length; j++) {
myField[i][j] = new SpotInField(0,100,0,0,100,0);
}
}
FarmField(myField, displayDurationInSeconds);
}
}
class for coloring
class SpotInField {
public int fR, fG, fB, bR, bG, bB;
public SpotInField(int fillR, int fillG, int fillB, int borderR, int borderG, int borderB) {
fR = fillR;
fG = fillG;
fB = fillB;
bR = fillR;
bG = fillG;
bB = fillB;
}
}