Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Quits the game
- */
- private void quit()
- {
- //First confirm the player is sure they want to quit.
- Printer.outputText("Are you sure you want to quit? (y/n)");
- //If yes
- if (parser.getNextInput().equalsIgnoreCase("Y"))
- {
- //Ask if they want to save the game
- Printer.outputText("Would you like to save the game first? (y/n)");
- if (parser.getNextInput().equalsIgnoreCase("Y"))
- {
- //If yes, call the Save() method
- save();
- }
- //Else, it's okay to terminate the game
- world.endGame();
- }
- }
Add Comment
Please, Sign In to add comment