Browse Source

Added functionality on button press for the sixth button

master
TRC9696 2 years ago
parent
commit
74c9ce244a
  1. 18
      src/main/java/game/StartTicTacToeGame.java

18
src/main/java/game/StartTicTacToeGame.java

@ -239,5 +239,23 @@ public class StartTicTacToeGame implements ActionListener{
player2button5Pressed = true; player2button5Pressed = true;
} }
} }
else if(e.getSource() == button6) {
if(player1Turn) {
button6.setForeground(Color.black);
button6.setText("X");
button6.setFont(new Font("arial", Font.PLAIN, 30));
player2Turn();
button6.setEnabled(false);
player1button6Pressed = true;
}
else {
button6.setForeground(Color.black);
button6.setText("O");
button6.setFont(new Font("arial", Font.PLAIN, 30));
player1Turn();
button6.setEnabled(false);
player2button6Pressed = true;
}
}
} }
} }
Loading…
Cancel
Save