|
|
@ -185,5 +185,23 @@ public class StartTicTacToeGame implements ActionListener{ |
|
|
|
player2button2Pressed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(e.getSource() == button3) { |
|
|
|
if(player1Turn) { |
|
|
|
button3.setForeground(Color.black); |
|
|
|
button3.setText("X"); |
|
|
|
button3.setFont(new Font("arial", Font.PLAIN, 30)); |
|
|
|
player2Turn(); |
|
|
|
button3.setEnabled(false); |
|
|
|
player1button3Pressed = true; |
|
|
|
} |
|
|
|
else { |
|
|
|
button3.setForeground(Color.black); |
|
|
|
button3.setText("O"); |
|
|
|
button3.setFont(new Font("arial", Font.PLAIN, 30)); |
|
|
|
player1Turn(); |
|
|
|
button3.setEnabled(false); |
|
|
|
player2button3Pressed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |