Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
text-rpg/main_menu.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
43 lines (37 sloc)
1.01 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include "tolower.cpp" | |
#include "game_start.cpp" | |
using namespace std; | |
//displays welcome message and menu options | |
void show_menu_text(){ | |
cout << "~~~~~~~~~~~~~~~" << endl; | |
string welcome_message = "Welcome to *game name here*"; | |
cout << welcome_message << endl; | |
cout << "Select an option:" << endl; | |
cout << "Play" << endl; | |
cout << "Quit" << endl; | |
cout << "~~~~~~~~~~~~~~~" << endl; | |
} | |
//handle what the player inputs | |
void select_main_menu_option(){ | |
string main_option; | |
do{ | |
//string to hold the text that the player enters | |
getline(cin,main_option); | |
main_option = convert_to_lower(main_option); | |
if (main_option == "quit"){ | |
return; | |
} | |
//to start a new game | |
if (main_option == "play"){ | |
cout << "You wish to embark along the path of the underlings? So be it..." << endl; | |
cout << "~~~~~~~~~~~~~~~~~" << endl; | |
//start opening sequence to game | |
opening_sequence(); | |
} | |
else{ | |
cout << "Menu Choice Not Valid" << endl; | |
} | |
}while(main_option != "quit"); | |
} |