New: AI Generated GUI

This commit is contained in:
2026-04-14 17:31:00 +02:00
parent 42dcd2cc26
commit 044270c813
3 changed files with 103 additions and 30 deletions

View File

@@ -25,9 +25,14 @@ public class Cat extends Player{
int posX = Integer.parseInt(inputArr[0]);
int posY = Integer.parseInt(inputArr[1]);
movePlayer(posX, posY);
}
public void movePlayer(int posX, int posY) throws IOException {
if (!gArea.validatePosition(new Position(posX,posY))) {
System.out.println("Invalid input!");
System.exit(1);
if (scanner != null && scanner.hasNext()) System.exit(1); // Only exit if in console mode
return;
}
Position p = gArea.playingField[posX][posY];