Contol Windwo Update. Velocity Change implemented. FONT and some other Var and method needs to be implemented in the GUI class not in Menu Window
Update Generation in Game Windoms title.
This commit is contained in:
@@ -2,7 +2,6 @@ package game;
|
||||
|
||||
import gui.GUI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class Control {
|
||||
@@ -139,7 +138,7 @@ public class Control {
|
||||
public void nextGen() {
|
||||
|
||||
gen++;
|
||||
// System.out.println("Generation:" + gen);
|
||||
System.out.println("Generation:" + gen);
|
||||
|
||||
for (int x = 0; x < xSize; x++) {
|
||||
for (int y = 0; y < ySize; y++) {
|
||||
@@ -164,7 +163,7 @@ public class Control {
|
||||
cells[x][y] = newcells[x][y];
|
||||
}
|
||||
}
|
||||
|
||||
gui.updateGameWindowTitle(gen);
|
||||
}
|
||||
|
||||
// public void checkN(Boolean[][] arr, Boolean[][] futureGen, int columns, int rows) {
|
||||
@@ -196,6 +195,7 @@ public class Control {
|
||||
public boolean[][] nextGenBackup() {
|
||||
|
||||
gen++;
|
||||
|
||||
// System.out.println("Generation:" + gen);
|
||||
|
||||
for (int x = 0; x < xSize; x++) {
|
||||
@@ -227,6 +227,7 @@ public class Control {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return cells;
|
||||
}
|
||||
|
||||
@@ -351,6 +352,10 @@ public class Control {
|
||||
nextGen();
|
||||
}
|
||||
}
|
||||
|
||||
public int getGeneration(){
|
||||
return gen;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user