1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
#include <iostream>
#include <ctime>
#include <string>
//#define newline endl
//#undef newline
using namespace std;
//The way to pause the program or messages to make readable you must type wait(T) T represents seconds i believe
void wait(int wait_time);
int launch(bool b);
//bool var_status = false;
bool var_status = true;
char var_name [11];
int main()
{
cout << "Welcome to the Text Quest Game." << endl;
wait(1);
cout << "This is a text type game. Using only a console for actions and more." << endl;
wait(4);
cout << "Please Enter Your Name: ";
cin >> var_name;
cout << endl;
system("cls");
cout << "Welcome to Text Quest " << var_name;
wait(4);
system("cls");
launch(var_status);
}
void wait(int wait_time)
{
long *start_time = new long;
*start_time = time(0);
while ((*start_time + wait_time) > time(0)){
};
delete start_time;
};
int launch(bool b)
{
bool var_stat = b;
if (var_stat == true) {
cout << "This game is launching loader.";
wait(3);
system("Cls");
cout << "Loading Map / Locations" << endl;
/// Syntex for Path directions below
/*
1 = N
2 = E
3 = S
4 = W
5 = NE
6 = ES
7 = SW
8 = NW
9 = NES
10 = ESW
11 = NSE
12 = NEW
13 = NESW
14 = EW
15 = NS
*/
cout << "Loading Map Area Data" << endl;
int locations [6] [6]= {{101,5,14,12,14,4},{5,7,5,10,12,4},{3,1,3,5,7,1},{2,13,14,10,14,11},{5,10,8,5,12,4},{3,2,10,7,6,102}};
cout << "Load Map Area Data Completed successfully" <<endl;
cout << "Starting Game.";
wait(3);
system("cls");
}
else if (var_stat == false) {
cout << "Sorry but this game has a status of Incomplete. You may not play this game. Sorry for any let downs." << endl;
}
else cout << "Error: Variable Stat has a invalid Value! Game ending";
return 0;
}
|