Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Developer: Matthew AKA Cawmbat - Combat - Calm Bat - Clam Bat
- //heckxx is cool
- //Program: Text Adventure 3000
- //Include List.
- #include <cstdio>
- #include <cstdlib>
- #include <iostream>
- #include <conio.h>
- #include <time.h>
- #include <ctime>
- #include <windows.h>
- #include <fstream>
- //Vital.
- using namespace std;
- //Variable List.
- string VillageChoice = "n";
- char UselessInput;
- char ChoiceN = 'n';
- int MenuInput = 0;
- //Function List.
- void Menu();
- void Save();
- void Load();
- //This Function Displays the Menu When Called.
- void Menu()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
- cout << "================================" << endl;
- cout << " 1. New Game! " << endl;
- cout << " 2. Load Game! " << endl;
- cout << " 3. Quit! " << endl;
- cout << "================================" << endl;
- cout << "Enter a Number For Your Selection" << endl;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- cin >> MenuInput;
- }
- //This Function Saves the Game When Called.
- void Save()
- {
- }
- //This Function Loads the Game When Called.
- void Load()
- {
- }
- //This is the Main Code.
- int main()
- {
- //This Line of Code is Used To Generate Random Numbers.
- srand((unsigned)time(0));
- //Run the First Time the Game is Opened.
- cout << "Welcome to Text Adventure 3000. Press any key to continue!" << endl;
- cin >> UselessInput;
- //Do Loop That Contains Most of the Game. Used For Menu and Quitting.
- do
- {
- if (MenuInput == 0)
- {
- //Runs the Menu Function (See Above), Then Clears Screen.
- Menu();
- system("cls");
- }
- else
- {
- //If the Meny Input Entered by the User is 1, Then Run This.
- if (MenuInput == 1)
- {
- //Loading a New Game...
- cout << "A new game is starting...Please wait... \n" << endl;
- Sleep(4000);
- //Opening Sequence, Then Clear Screen to Begin Game.
- cout << "Welcome to your new adventure, brave traveller! ...Na, let's face it, you are \n"
- "not brave. You simply washed up on shore on some weird island after your yacht \n"
- "got caught in a storm. But now you're gonna have to learn to be brave, or at thevery least, fake it. I hope"
- " you're ready for..." << endl;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
- cout << "TEXT ADVENTURE 3000" << endl;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
- cout << "Press any key to start your journey!" << endl;
- cin >> UselessInput;
- system("cls");
- //Starting Journey!
- cout << "You wake up on a sandy beach. You hate sand. It makes you irritable. Of course \n"
- "you are just focusing your attention on other things to avoid the crushing \n"
- "realization that you are now stranded ashore on a strange island. You get up, \n"
- "brush yourself off, and notice a conveniently placed sign in front of you \n"
- "exclaiming 'Village This Way!'. Before you start moving, a low growl wafts out \n"
- "of the treeline onto the beach. It sounds big and extremely threatening." << endl;
- cout << "Do you run as fast as you can towards the village and don't look back <Y/N>?" << endl;
- //Adjusts the Game According to the Choices the User Makes.
- do
- {
- string VillageChoice = "n";
- if (VillageChoice == "y" || VillageChoice=="Y")
- {
- UselessInput = 'g';
- }
- else if (VillageChoice == "n" || VillageChoice=="N")
- {
- cout << "You stay around regardless of the obvious danger. Why would you do that? "
- "A giant LION bursts out of the trees and maims you until you run out of blood and organs" << endl;
- cout << "You are Dead. Press a key to restart the adventure...Moron." << endl;
- cin >> UselessInput;
- }
- else
- {
- cout << "You didn't pick y or n. Try again.";
- }
- }
- while (VillageChoice != "y" || "Y" || "n" || "N");
- }
- }
- }
- while (MenuInput != 4);
- //User Leaves the Game.
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 1);
- cout << "GoodBye!" << endl;
- //Waits For User To Press Any Key.
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement