/*Start Up Screen*/ bool dope::Start() { for (int i = 0; i < 80; i++) { cout << '\xb1'; } SetConsoleTextAttribute(GetStdHandle (STD_OUTPUT_HANDLE), 3); cout << '\xb1' << "\t\t\t\tVERSION #1\t\t\t\t " << '\xb1'; for (int j = 0; j < 80; j++) { cout << '\xb1'; } cout << endl << endl; init(); cout << "\n\n\n\n\n\n\n\t\t1 = Start\t2 = Instructions\t3 = Quit: "; cin >> decision; if (decision == 1) { Adventure(); } else if (decision == 2) { Instruction(); } else { exit(3); } return 0; }
/* Adventure - where it all begins */ void dope::Adventure() { do { Status(); printf("\t\t\t Cities to Run \n"); /*Level - Menu*/ cout << "\t\t\t" << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << " " << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << " 1. Detroit " << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << " 2. New York " << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << " 3. California " << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << " 4. Miami " << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << " 5. Give Up " << '\xb1' << endl; cout << "\t\t\t" << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << '\xb1' << endl; cout << "\t\t\tChoice: "; cin >> decision; switch (decision) { case 1: if (money < 2000) { cout << "Whoa!\nYour money is low... $" << money << "\nLevel Locked!\n"; Adventure(); } else { Detroit(); } break; case 2: if (money <= 10000) { cout << "Whoa!\nYour money is low... $" << money << "\nLevel Locked!\n"; Adventure(); } else { Detroit(); } break; case 3: if (money <= 22000) { cout << "This board will be available in version #2...\nLevel Locked!\n"; Adventure(); } break; case 4: if (money <= 33000) { cout << "This board will also be available in version #2...\nLevel Locked!\n"; Adventure(); } break; case 5: exit(5); break; default: cout << "Invalid Choice!\n"; break; } } while (decision < 1 || decision > 4); }
int main(int argc, char* argv[]) { char* locale = setlocale(LC_ALL, "German"); // Get the CRT's current locale. std::locale lollocale(locale); setlocale(LC_ALL, locale); // Restore the CRT. wcout.imbue(lollocale); // Now set the std::wcout to have the locale that we got from the CRT. wcout << L"Please input the path to your currentAdventure" << endl; wstring path; getline(wcin, path); wcout << L"Read in the file " << path << "..." << endl; auto currentAdventure = Adventure(path); #ifdef _DEBUG wcout << L"You put in the following map" << endl; wcout << currentAdventure.CurrentMap->GetData() << endl; #endif wcout << L"Parsing currentAdventure, please wait..." << endl; currentAdventure.CurrentMap->Parse(); wcout << L"Let the game begin" << endl; system("cls"); wcout << GREATINGTEXT << endl << endl; wcout << L" _____ _ _ " << endl; wcout << L"/__ \\_____ _| |___ _____ _ __ | |_ _ _ _ __ ___ " << endl; wcout << L" / /\\/ _ \\ \\/ / __\\ \\ / / _ \\ '_ \\| __| | | | '__/ _ \\" << endl; wcout << L" / / | __/> <| |_ \\ V / __/ | | | |_| |_| | | | __/" << endl; wcout << L" \\/ \\___/_/\\_\\\\__| \\_/ \\___|_| |_|\\__|\\__,_|_| \\___|" << endl; wcout << L" " << endl << endl; wcout << GOAL << endl << endl; wcout << GOODLUCK << endl; wcin.get(); system("cls"); currentAdventure.DrawMap(); auto exit = false; while (!exit) { auto key = _getch(); switch (currentAdventure.CurrentSituation) { case ::Walking: switch (key) { case 27: exit = true; break; case 80: currentAdventure.Move(::Down); break; case 72: currentAdventure.Move(::Up); break; case 77: currentAdventure.Move(::Right); break; case 75: currentAdventure.Move(::Left); break; } break; case ::Fighting: switch (key) { case 27: if (currentAdventure.CurrentFight->GetStatus() == Won) { currentAdventure.ExitFight(); } else { currentAdventure.LooseFight(); } break; case 97: currentAdventure.CurrentFight->Attack(); break; case 98: currentAdventure.CurrentFight->Block(); break; } break; default: switch (key) { case 27: exit = true; break; } } } return 0; }