Skip to content
Snippets Groups Projects
Commit 989c46c4 authored by Nick's avatar Nick
Browse files

abwechseln der züge

parent b49e4aee
No related branches found
No related tags found
1 merge request!2Fehler fix
......@@ -9,12 +9,22 @@ public class SceneController {
private Actor player;
private Actor enemy;
boolean playerTurn = true;
public void initData(Board board, Actor player, Actor enemy) {
this.board = board;
this.player = player;
this.enemy = enemy;
}
public void playerTurn(){
this.playerTurn = true;
}
public void aiTurn(){
this.playerTurn = false;
}
@FXML
private GridPane gridPane;
......@@ -33,7 +43,7 @@ public class SceneController {
int row = GridPane.getRowIndex(pressedButton); // Zeilen-Koordinate
int col = GridPane.getColumnIndex(pressedButton); // Spalten-Koordinate
if(buttonText.equals(" ")) {
if(buttonText.equals(" ") && playerTurn) {
// Setze X
pressedButton.setText("X");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment