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
This commit is contained in:
@@ -9,7 +9,7 @@ public class Control {
|
||||
private GUI gui;
|
||||
private Clock clock;
|
||||
|
||||
private int xSize, ySize, cellCount, gen = 0;
|
||||
private int xSize, ySize, cellCount, gen;
|
||||
|
||||
private boolean[][] cells;
|
||||
private boolean[][] newcells;
|
||||
@@ -22,14 +22,14 @@ public class Control {
|
||||
|
||||
public void start() {
|
||||
|
||||
clock = new Clock();
|
||||
clock = new Clock(this, gui, 1000);
|
||||
gui = new GUI(this);
|
||||
gui.createMenuWindow();
|
||||
|
||||
}
|
||||
|
||||
public void startGame() {
|
||||
clock.start(this, gui, 200);
|
||||
clock.start();
|
||||
}
|
||||
|
||||
public void buildGameWindow(int xSize, int ySize, int cellCount, StartMode startMode) {
|
||||
@@ -37,6 +37,8 @@ public class Control {
|
||||
this.ySize = ySize;
|
||||
this.cellCount = cellCount;
|
||||
|
||||
gen = 0;
|
||||
|
||||
cells = new boolean[this.xSize][this.ySize];
|
||||
newcells = new boolean[this.xSize][this.ySize];
|
||||
|
||||
@@ -279,6 +281,10 @@ public class Control {
|
||||
public boolean isRunning(){
|
||||
return clock.isRunning();
|
||||
}
|
||||
|
||||
public void setVelocity(int velocity){
|
||||
clock.setVelocity(velocity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user