This commit is contained in:
Noah
2021-10-01 10:25:38 +02:00
parent 2c1a86dfab
commit 23fdc43f8a
3 changed files with 9 additions and 6 deletions
+6 -4
View File
@@ -216,16 +216,18 @@ public class Control {
}
public void addCell(int x, int y) {
System.out.print("X" + x + "|" + "Y" + y + " ");
public void addCell(int mouseX, int mouseY) {
System.out.print("X" + mouseX + "|" + "Y" + mouseY + " ");
System.out.println((int) (x / (800f / xSize)));
// cells[(int) ((x / (800f / xSize)) + ((800f / xSize)/2))][(int) ((y / (800f / ySize)) + ((800f / ySize)/2))] = true;
System.out.println(mouseX / (800 / xSize) + " ");
cells[(mouseX - 30) / (800 / xSize)][(mouseY - 30) / (800 / ySize)] = true;
showGrid(cells);
}
public void removeCell(int x, int y) {
cells[Math.round(y/(800f/xSize))][Math.round(y/(800f/ySize))] = false;