First Size Calculating

This commit is contained in:
Noah
2021-10-03 22:39:26 +02:00
parent e2c07d8d2e
commit 9cb505d4da
4 changed files with 46 additions and 20 deletions
+17 -1
View File
@@ -17,6 +17,8 @@ public class Control {
private int x = 0;
private int y = 0;
private int width, height;
public void start() {
@@ -57,7 +59,9 @@ public class Control {
gui = new GUI(this);
}
gui.createGameWindow(this.xSize, this.ySize);
calcSize();
gui.createGameWindow(this.xSize, this.ySize, this.width, this.height);
startGame();
@@ -243,6 +247,18 @@ public class Control {
gui.showGrid(cells);
}
private void calcSize(){
float c = 800;
width = Math.round(xSize * (c / xSize));
height = Math.round(ySize * (c / ySize));
System.out.println(xSize + " " + width);
System.out.println(ySize + " " + height);
}
private boolean checkCellCount() {
int counter = 0;