Test out this code BOIZ
This commit is contained in:
@@ -213,6 +213,7 @@ public class Player {
|
||||
public void gameOver(){
|
||||
System.out.flush();
|
||||
System.out.println("Game over");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public boolean playAgain(){
|
||||
|
||||
@@ -322,9 +322,7 @@ public class ShipWarfare {
|
||||
return true;
|
||||
} else if (exitValue == 2) {
|
||||
player.gameOver();
|
||||
if(player.playAgain()){
|
||||
setPlayer(new Player());
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (exitValue == 3) {
|
||||
System.out.printf("We made it out at %d%% ship status!\n", player.getHP());
|
||||
@@ -453,9 +451,6 @@ public class ShipWarfare {
|
||||
return true;
|
||||
} else if (exitValue == 2) {
|
||||
player.gameOver();
|
||||
if(player.playAgain()){
|
||||
setPlayer(new Player());
|
||||
}
|
||||
return true;
|
||||
} else if (exitValue == 3) {
|
||||
System.out.printf("We made it out at %d%% ship status!\n", player.getHP());
|
||||
|
||||
Reference in New Issue
Block a user