Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Text-Game/Game Start - working base
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
95 lines (83 sloc)
3.13 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <stdlib.h> | |
using namespace std; | |
int main() | |
{ | |
{ | |
char name[50]; | |
std::cout << "What is your name, hero?" << std::endl; | |
std::cin.getline(name, 50); | |
std::cout << "You better move fast, " << name << ". The goblins are attacking the city and the people need your help." << std::endl; | |
system("PAUSE"); | |
int _getch(); | |
} | |
system("cls"); | |
int choiceOne_Path; | |
std::cout << "#What are you going to do?" << std::endl; | |
std::cout << "\t >> Enter '1' to run towards the city" << std::endl; | |
std::cout << "\t >> Enter '2' to run away" << std::endl; | |
retry: | |
std::cout << "\nEnter your choice "; | |
std::cin >> choiceOne_Path; | |
if (choiceOne_Path == 1) | |
{ | |
std::cout << "\n!!!----------------------Chapter One: Escape----------------------!!!" << std::endl; | |
std::cout << "\nYou: We have to save the civilians!" << std::endl; | |
std::cout << "Chief: Here, take one of these, you'll need it" << std::endl; | |
std::cout << "# You take the sword and run towards the city with the chief" << std::endl; | |
system("PAUSE"); | |
return 0; | |
} | |
else if (choiceOne_Path == 2) | |
{ | |
std::cout << "\n!!!----------------------Chapter One: Escape----------------------!!!" << std::endl; | |
std::cout << "Chief: We need to get away while we still can" << std::endl; | |
std::cout << "\nYou: We can't just leave the civilians behind!" << std::endl; | |
std::cout << "Chief: There isn't anytime, follow me" << std::endl; | |
std::cout << "# The chief leads you away from the chaos deep into the forest" << std::endl; | |
system("PAUSE"); | |
} | |
else | |
{ | |
std::cout << "You're doing it wrong hero! Press either '1' or '2', that's all!" << std::endl; | |
goto retry; | |
} | |
std::cout << "\n----------------------Press any key to continue----------------------" << std::endl; | |
int _getch(); | |
system("cls"); | |
switch (choiceOne_Path) | |
{ | |
case 1: std::cout << "" << std::endl; | |
case 2: int choiceTwo2_Path; | |
std::cout << "\n!!!----------------------Chapter Two: Surviving after the Attack----------------------!!!" << std::endl; | |
std::cout << "Chief: We need to build a tent to stay the night and collect some food..hmm..fruits is a good idea" << std::endl; | |
std::cout << "\nYou: Which one you want me to do?" << std::endl; | |
std::cout << "Chief: Choose, do what you prefer, I'll do the other one" << std::endl; | |
std::cout << "#Which task are you going to do?" << std::endl; | |
std::cout << "\t >> Enter '1' to collect food" << std::endl; | |
std::cout << "\t >> Enter '2' to make a tent" << std::endl; | |
retry1: | |
std::cout << "\nEnter your choice "; | |
std::cin >> choiceTwo2_Path; | |
if (choiceTwo2_Path == 1) | |
{ | |
std::cout << "You:I will take some food" << std::endl; | |
std::cout << "\nChief:That's fine, I'll make the tent" << std::endl; | |
system("PAUSE"); | |
return 0; | |
} | |
else if (choiceTwo2_Path == 2) | |
{ | |
std::cout << "You:I'll do the tent, I believe I'm better doing it rather than pick up food" << std::endl; | |
std::cout << "\nChief:That's fine, see you in a couple of minutes then" << std::endl; | |
system("PAUSE"); | |
return 0; | |
} | |
else | |
{ | |
std::cout << "You're doing it wrong hero! Press either '1' or '2', that's all!" << std::endl; | |
goto retry1; | |
} | |
} | |
} |