Skip to content
Permalink
Browse files
quit condition moved here, and bug fix with cin.ignore
  • Loading branch information
Nathan Brown committed Aug 9, 2018
1 parent 6f63c9a commit bd6c0464daa56c812aaaffe83c604c4f56803bf2
Showing 1 changed file with 21 additions and 18 deletions.
@@ -18,23 +18,26 @@ void show_menu_text(){
}

//handle what the player inputs
bool select_main_menu_option(){

//string to hold the text that the player enters
void select_main_menu_option(){
string main_option;
getline(cin,main_option);
main_option = convert_to_lower(main_option);

if (main_option == "quit"){
return true;
}
//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;
opening_sequence();
}
else{
cout << "Menu Choice Not Valid" << endl;
}
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");
}

0 comments on commit bd6c046

Please sign in to comment.