Thats not what I meant, admkrk, and my thing is already solved. It involves a while true loop, with the if statements inside, and continue statements at the end of each if.
while (true) {
switch (state) {
case 0:
do stuff;
state = 3;
break;
case 1:
do other stuff
if (blah blah) {
yadda yadda
state = 0;
} else {
yabba dabba doo.
state = 3;
}
break;
case 3:
more stuff
state = 1;
break;
}
}
If this looks good then use an enum to represent the state instead of an integer. The enum names can be a lot more meaningful.
The title of this topic is "Wondering about if statements", and that was what I was referring to. I was also going by your question:
I am making a text adventure game, that uses a lot of classes, and definitely if statements. So mu question is this: Is there a way to 'break' out of an if statement, like the continue keyword for loops? I want this so I can go up the evaluation order for like a player going up to another room.
You only mentioned a loop as an example of how you wanted to change the flow.
I am not offended, or intending to offend, just saying.