#include <iostream>
#include <string>
usingnamespace std;
int main()
{
int audrey=0;
int cupboard=0;
cout << "everything is so dark....." << endl;
cin.get();
cout << "\"HEY WAKE UP\"" << endl;
cin.get();
cout << "You open your eyes" << endl;
cin.get();
cout << "You find youself in a dark room" << endl;
cin.get();
cout << "You try to locate the voice but cant seem to find it.....";
cin.get();
cout << "\"ON THE CUPBOARD\"";
cin.get();
cout << "upon a quick look you realize that the voice is coming from a walkie talkie on" << endl << "the cupboard";
cin.get();
cout << "You pick up the walkie talkie" << endl;
cin.get();
cout << "smashing now what your name?";
cout << "(press enter and Choose name)";
cin.get();
string Charname;
cin >> Charname;
cout << "well splendid " << Charname<< " " << endl;
cin.get();
cout << "ok now here's the deal" << endl;
cin.get();
cout << "well you see " << Charname << " this room is your prison" << endl;
cin.get();
cout << "and no there will be no food" << endl;
cin.get();
cout << "You can however escape from here" << endl;
cin.get();
cout << "find the key, get out good luck";
cin.get();
cout << "You start looking around the room,and see 3 places worth" << endl << "searching" << endl;
cout << "there is" << endl;
int Pindus;
teleport:
cout << "1 - a bed" << endl;
cout << "2 - a closet" << endl;
cout << "3 - a cupboard" << endl;
cin >> Pindus;
switch (Pindus)
{
case 1:
cout << "the bed look kinda comfy but really dusty" << endl << endl << endl;
goto teleport;
case 2:
cout << "you open the closet and find a cute little plant" << endl;
cin.get();
cout << "you examine the plant when it suddenly starts to talk!"<< endl;
cin.get();
cout << "Feed me " << Charname << " and i'll give you whatever you whant";
cin.get();
cout << "you toss a bucket of fish you had in your backpocket"<<endl << "the plant spat it out furiously knocking you over and closing the door" << endl;
cin.get();
cout << "you landed on top of the rug and felt something hard under the rug!";
cin.get();
cout << "with a sigh of relief you find the key under the rug and put it in" << endl << "your pocket" << endl;
cin.get();
audrey=1;
cout << endl << endl << endl;
break;
case 3:
cout << "This was a nice cupboard you might take it if you get out of here" << endl;
cin.get();
if (audrey==0)
{
cupboard=1;
}
goto teleport;
cout << endl << endl << endl;
break;
}
if (audrey==1 && cupboard==1)
{
cout << "you take the cupboard and shove it in your backpocket" << endl;
cin.get();
cout << "you run for the door filled with joy!" << endl;
cin.get();
cout << "you turn the key in the lock and feel how the door slowly opens" << endl;
cin.get();
cout << "you've escaped congratulations!";
cin.get();
return 0;
}
if(audrey ==1 && cupboard==0)
{
cout << "You run for the door filled with joy!" << endl;
cout << "You turn the key in the lock and feel how the door slowly opens" << endl;
cout << "but suddenly the door slams shut and you hear a voice from the closet" << endl << "\"\"" << Charname << "\"\"" << endl;
cout << "You did not escape..........";
cout << "Game over";
return 0;
}
}
audrey and cupboard are ints. Use if (audrey==1 && cupboard== 1) and if (audrey==1 && cupboard==0) instead for checking. Also, remove the terminating semi-colons you have at the end of the if(aud...) lines.
On lines 87 and lines 99 you have: if (condition);
This is a blank statement. That means, if the condition is true, excecute the statement before the semi-colon. But there's nothing there so nothing will be excecuted.
Then the code in the {...} will be executed regardless of the condition in the if statement as it is unrelated.
As for your issue with selecting 1 or 2, I see some gotos in there. I'm not going to get involved in anything like that. I suggest replacing that stuff with some structured programming using loops.