In this game, I was successful in making and learning how to make classes. I put in a few basic functions in source files. Today, I wanted to add in a menu function the game could be played and adjusted within. The problem is the string's seem to never break. Here is what I did, which is the result of me rethinking how I should be spending my time with C++.
within the main.cpp
while(ourHero.getHealth()>0) // Our main player(class)
{
cout << "Please make a selection:\n\n[1]The Armory\n\n[2]The Pit\n\n[3]Item Shop\n\n[4]Quit Game\n";
int menuSelect;
cin >> menuSelect;
switch(menuSelect)
{
case 1:
{
system("cls");
cout << "Welcome to The Frorth City Armory\n\n";
Sleep(1500);
cout << "What would you like to do?\n\n[1]Upgrade Main-hand Weapon\n\n[2]Upgrade Off-hand Weapon\n\n[3]Exit\n";
int choice;
cin >> choice;
switch(choice)
{
case 1:
{
ourWeapon.sharpenWeapon1();
system("cls");
cout << "Main-hand sharpened!";
break;
}
case 2:
{
ourWeapon.sharpenWeapon2();
system("cls");
cout << "Off-hand sharpened!";
break;
}
case 3:
{
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue\n";
cin.ignore();
cin.get();
system("cls");
}
}
break;
}
case 2:
{
cout << " The Pit is currently closed!";
}
case 3:
{
cout << "Out to lunch";
break;
}
case 4:
{
cout << "Are you sure you wish to exit Sabra?\n[Y]es?";
cin.get();
break;
}
default:
{
cout << "Invalid selection.\n\n";
cout << "Please press enter to continue\n";
cin.ignore();
cin.get();
system("cls");
}
}
}