ok, ive only just started this game, this game genra, and this language, so bear with me
i think its started alright
COMPILE IN DEV C++, OR DOWNLOAD THE SMALL EXECUTABLE.
#include <cstdlib>
#include <iostream>
using namespace std;
class segmant
{
public:
string dialog;
string options[5];
int destination[5];
};
int main(int argc, char *argv[])
{
int current_room=0;
segmant room[100];
int status[10]={10,10,0,0,0,0,0,0,0,0};
room[0].dialog="you wake up in a dark room, you have no memory of how you got there, you wait a few seconds for your eyes to ajust to the light and have a look around.\nyou see a chest in the corner, and a door on the far wall of the room...\n";
room[0].options[0]="\npress 1 to: open the chest? \n";
room[0].destination[0]=1;
room[0].options[1]="\npress 2 to: try the door. \n\n";
room[0].destination[1]=2;
room[1].dialog="you open the chest, you see a fresh looking piece of meat, \ndo you want to take the meat?\n";
room[1].options[0]="\npress 1 to: take the meat. \n";
room[1].destination[0]=3;
room[1].options[1]="\npress 2 to: leave the meat \n\n";
room[1].destination[1]=4;
room[2].dialog="you walk over to the door, you dont expect it to work, but when\nyou turn the handle, the door opens! you walk out into the middle\nof a corridor, you can go left or right.\n";
room[2].options[0]="\npress 1 to: turn left\n";
room[2].destination[0]=6;
room[2].options[1]="\npress 2 to: turn right.\n";
room[2].destination[1]=7;
room[2].options[2]="\npress 3 to: return to the room.\n\n";
room[2].destination[2]=0;
room[3].dialog="you take the meat and put it in you back pack.\n";
room[3].options[0]="\npress 1 to: continue.\n\n";
room[3].destination[0]=0;
room[4].dialog="you decide that you dont trust the meat, and leave it.\n";
room[4].options[0]="\npress 1 to: continue\n\n";
room[4].destination[0]=0;
room[5].dialog="you already have the meat.\npress 1 to: continue\n\n";
room[5].options[0]="";
room[5].destination[0]=0;
room[6].dialog="you come to a large heavy door, you try to open it, but its locked tight\ntheres a keyhole...\n";
room[6].options[0]="\npress 1 to: return to the first room.\n";
room[6].destination[0]=0;
room[6].options[1]="\npress 2 to: go straight down the corridor\n";
room[6].destination[1]=7;
room[6].options[2]="\npress 3 to: use a key, if you have it.\n\n";
room[6].destination[2]=10;
room[7].dialog="you walk to the end of the corridor, there are three holes in the wall,\nthere is an inscription above the the holes...\na man who always lies says its the 1st hole\na man who somtimes lies says its not the 3rd hole\na man who always tells the truth says there both lying.\n";
room[7].options[0]="\npress 1 to: put your hand in the 1st hole.\n";
room[7].destination[0]=8;
room[7].options[1]="\npress 2 to: put your hand in the 2nd hole.\n";
room[7].destination[1]=8;
room[7].options[2]="\npress 3 to: put your hand in the 3rd hole.\n";
room[7].destination[2]=9;
room[7].options[3]="\npress 4 to: return to the room you started in.\n";
room[7].destination[3]=0;
room[7].options[4]="\npress 5 to: go back to the other end of the corridor.\n\n";
room[7].destination[4]=6;
room[8].dialog="you slowly put your hand into the hole, suddenly, somthing smashes down on you hand, \nyou pull it out in pain!\nyou lose one stamina point and one strength point\n";
room[8].options[0]="\npress 1 to: continue\n\n";
room[8].destination[0]=7;
room[9].dialog="you reach inside, and feel a small metal object, you pull it out.\nyou have found a key1.\n";
room[9].options[0]="\npress 1 to: return to the room you started in.\n";
room[9].destination[0]=0;
room[9].options[1]="\npress 2 to: go back to the other end of the corridor.\n\n";
room[9].destination[1]=6;
room[10].dialog="";
for(;;)
{
cout << room[current_room].dialog << room[current_room].options[0]<< room[current_room].options[1]<< room[current_room].options[2]<< room[current_room].options[3]<< room[current_room].options[4];
int reply;
cin>> reply;
current_room=room[current_room].destination[reply-1];
switch (current_room)
{
case 0:
room[0].dialog="you are in the room you woke up in, there is the chest\nand the door.\n";
break;
case 1:
if (status[2]==1){room[0].destination[0]=5;}
if(reply==1){status[2]=1;}
break;
case 8:
room[7].dialog="there are three holes in the wall,\nthere is an inscription above the the holes...\na man who always lies says its the 1st hole\na man who somtimes lies says its not the 3rd hole\na man who always tells the truth says there both lying.\n";
if (reply==1 || reply==2){status[0]--; status[1]--;cout << "your strength: " << status[0] << endl << "your stamina: " << status[1] << endl;}
break;
case 9:
status[3]=1;
break;
case 10:
if (status[3]==1)
{
room[10].dialog="you use your key in the door, with a load clank, the door opens.\n";
room[10].options[0]="";
room[10].destination[0]=0;
room[10].options[1]="";
room[10].destination[1]=0;
}
else
{
room[10].dialog="you havnt got the required key.\n";
room[10].options[0]="\npress 1 to: return to the room you started in.\n";
room[10].destination[0]=0;
room[10].options[1]="\npress 2 to: go back to the other end of the corridor.\n\n";
room[10].destination[1]=7;
}
break;
}
}
system("PAUSE");
return EXIT_SUCCESS;
}