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