Add of restart option for the start a new game
This commit is contained in:
parent
d64e2962c9
commit
1df06a1068
|
|
@ -307,18 +307,21 @@ public class MyInterface extends JFrame {
|
|||
game.toggleAI(true);
|
||||
chckbxWhiteAI.setSelected(false);
|
||||
chckbxBlackAI.setSelected(false);
|
||||
Object[] options = {"YES", "NO"};
|
||||
Object[] options = {"YES", "NO", "Start a new game"};
|
||||
int choice = JOptionPane.showOptionDialog(this, "GAME OVER \nDo you want to exit? ",
|
||||
"Game Over",
|
||||
JOptionPane.DEFAULT_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[1] // default: Medium
|
||||
options[1] // default: NO
|
||||
);
|
||||
switch (choice) {
|
||||
case 0: System.exit(0);; // Easy
|
||||
case 1: ; // Medium
|
||||
case 0: System.exit(0); // exit
|
||||
case 1: ;
|
||||
case 2: clicButtonStart();
|
||||
break;
|
||||
default: ;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue