Need help understanding games in C++
I have been trying to write a simple text adventure program using if statements and functions. When I run the program it always reruns the program from the start. Also one of the commands should be exit to exit the game how is that done.
This is what I have but it is not working.
char exit(char)
{
cout << "press any key to continue....\n";
return 0;
}
cin >> direction;
if (direction = "r" || "R")
{
net();
}
if (direction = (char) exit)
{
char exit(char);
}
the other problem in main - it loops back through
void main ()
{
instructions();
startGame();
net();
}
I'm very new at this and very confused. If anyone has any suggestions it would sure help.
Thanks.