Advertisement
Guest User

Untitled

a guest
May 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. //Developer: Matthew AKA Cawmbat - Combat - Calm Bat - Clam Bat
  2. //heckxx is cool
  3. //Program: Text Adventure 3000
  4.  
  5. //Include List.
  6. #include <cstdio>
  7. #include <cstdlib>
  8. #include <iostream>
  9. #include <conio.h>
  10. #include <time.h>
  11. #include <ctime>
  12. #include <windows.h>
  13. #include <fstream>
  14.  
  15.  
  16.  
  17. //Vital.
  18. using namespace std;
  19.  
  20.  
  21.  
  22. //Variable List.
  23. string VillageChoice = "n";
  24. char UselessInput;
  25. char ChoiceN = 'n';
  26. int MenuInput = 0;
  27.  
  28.  
  29.  
  30. //Function List.
  31. void Menu();
  32. void Save();
  33. void Load();
  34.  
  35.  
  36.  
  37. //This Function Displays the Menu When Called.
  38. void Menu()
  39. {
  40. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
  41. cout << "================================" << endl;
  42. cout << " 1. New Game! " << endl;
  43. cout << " 2. Load Game! " << endl;
  44. cout << " 3. Quit! " << endl;
  45. cout << "================================" << endl;
  46. cout << "Enter a Number For Your Selection" << endl;
  47. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
  48. cin >> MenuInput;
  49. }
  50.  
  51.  
  52. //This Function Saves the Game When Called.
  53. void Save()
  54. {
  55.  
  56.  
  57. }
  58.  
  59.  
  60. //This Function Loads the Game When Called.
  61. void Load()
  62. {
  63.  
  64.  
  65. }
  66.  
  67.  
  68. //This is the Main Code.
  69. int main()
  70. {
  71. //This Line of Code is Used To Generate Random Numbers.
  72. srand((unsigned)time(0));
  73.  
  74. //Run the First Time the Game is Opened.
  75. cout << "Welcome to Text Adventure 3000. Press any key to continue!" << endl;
  76. cin >> UselessInput;
  77.  
  78.  
  79. //Do Loop That Contains Most of the Game. Used For Menu and Quitting.
  80. do
  81. {
  82. if (MenuInput == 0)
  83. {
  84. //Runs the Menu Function (See Above), Then Clears Screen.
  85. Menu();
  86. system("cls");
  87. }
  88. else
  89. {
  90. //If the Meny Input Entered by the User is 1, Then Run This.
  91. if (MenuInput == 1)
  92. {
  93. //Loading a New Game...
  94. cout << "A new game is starting...Please wait... \n" << endl;
  95. Sleep(4000);
  96.  
  97. //Opening Sequence, Then Clear Screen to Begin Game.
  98. cout << "Welcome to your new adventure, brave traveller! ...Na, let's face it, you are \n"
  99. "not brave. You simply washed up on shore on some weird island after your yacht \n"
  100. "got caught in a storm. But now you're gonna have to learn to be brave, or at thevery least, fake it. I hope"
  101. " you're ready for..." << endl;
  102. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 4);
  103. cout << "TEXT ADVENTURE 3000" << endl;
  104. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
  105. cout << "Press any key to start your journey!" << endl;
  106. cin >> UselessInput;
  107. system("cls");
  108.  
  109.  
  110. //Starting Journey!
  111. cout << "You wake up on a sandy beach. You hate sand. It makes you irritable. Of course \n"
  112. "you are just focusing your attention on other things to avoid the crushing \n"
  113. "realization that you are now stranded ashore on a strange island. You get up, \n"
  114. "brush yourself off, and notice a conveniently placed sign in front of you \n"
  115. "exclaiming 'Village This Way!'. Before you start moving, a low growl wafts out \n"
  116. "of the treeline onto the beach. It sounds big and extremely threatening." << endl;
  117. cout << "Do you run as fast as you can towards the village and don't look back <Y/N>?" << endl;
  118.  
  119. //Adjusts the Game According to the Choices the User Makes.
  120. do
  121. {
  122. string VillageChoice = "n";
  123. if (VillageChoice == "y" || VillageChoice=="Y")
  124. {
  125. UselessInput = 'g';
  126. }
  127. else if (VillageChoice == "n" || VillageChoice=="N")
  128. {
  129. cout << "You stay around regardless of the obvious danger. Why would you do that? "
  130. "A giant LION bursts out of the trees and maims you until you run out of blood and organs" << endl;
  131. cout << "You are Dead. Press a key to restart the adventure...Moron." << endl;
  132. cin >> UselessInput;
  133. }
  134. else
  135. {
  136. cout << "You didn't pick y or n. Try again.";
  137. }
  138. }
  139. while (VillageChoice != "y" || "Y" || "n" || "N");
  140.  
  141. }
  142.  
  143.  
  144.  
  145.  
  146. }
  147.  
  148.  
  149.  
  150.  
  151. }
  152. while (MenuInput != 4);
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. //User Leaves the Game.
  162. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 1);
  163. cout << "GoodBye!" << endl;
  164. //Waits For User To Press Any Key.
  165. system("PAUSE");
  166. return 0;
  167.  
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement