Multiple options with multiple states

The more you over complicate the plumbing the easier is to stop up the drain - Montgomery Scott.

This quote pretty much sums up what I’m trying to do to write a rather more extensive game.

I have the starting “room” set as control_0 which has the beginning screen for the game. After that it changes to control_1 with text not related to the beginning of the game which is psuedo-dialog.

The first action is to look through a door. The possible responses are to go back to control [state control_1], pick up a wrench which is then added to your inventory via a bool, rescue to the 2 men on the other side of the door [which is essentially to open the door and let them in]

The problem I’m hitting is if you go back to the door there are a number of possibilies:

men to rescue, get a wrench
men to rescue, no wrench
no men to rescue, get a wrench
no men to rescue, no wrench

My question to you all is would it make more sense to have an if check on the bool to modify the text and key options or create multiple states like -> private enum States {aftdoor_0, aftdoor_1, aftdoor_2, aftdoor_3}

something more like the code below where a different text object is set to hold the response options:

after_door_1(){

text.text = “You can see water rising through the window in the door.”;
responsetext.text = " Return to control room - ";

if (menpresent = true) {
text.text = text.text + " Two men can be seen and they appear to be asking for help, but you can’t hear them."
responsetext.text = responsetext.text + " Help the men - ";
}

if (wrench = false) {
text.text = text.text + "There is also a wrench laying on the deck.“
responsetext. text = text.text + " Pick up the wrench.”;
}

I’ve dreamed up a pretty complicated game and trying to get a feel for what might be the best practice to go. I have initially gone with different states but it’s getting a bit cludgy.

Thanks for any opinions!

Privacy & Terms