//Ceiling Option public static void Ceiling() { Clear(); WriteLine("\n You can see the silhouette of a lamp but it doesn't seems to work. Maybe there's something missing. \n "); WriteLine(" 1) Go back"); WriteLine(" 2) Open backpack \n"); //Looping thru the menu until a valid option in entered and then loading a new function bool input = true; do { string menuChoice = ReadLine(); switch (menuChoice) { case "1": bathroom.BathroomStart(); break; case "2": //If backbackresponse is matching string: Delete object and move on to BathroomView() string backpackResponse = foundObjects.OpenBackpack(); if (backpackResponse == "back") { Ceiling(); } else if (backpackResponse == "BathroomLamp") { Clear(); WriteLine("\n Yes, finally som light! Now you can se what's in the room."); ReadLine(); foundObjects.DeleteObject("Light-bulb"); BathroomView(); } else { WriteLine("\n Naahh...that didn't work"); ReadLine(); Ceiling(); } break; default: WriteLine("\n What are you trying to do? That's not a correct input Try again.."); input = false; break; } } while (input == false); }
//Menu option Basement door public static void BasementDoor() { Clear(); bool input = true; do { WriteLine("\n Hmm...a door. I wonder what's on the other side \n"); WriteLine(" 1) Try do open it"); WriteLine(" 2) Banging on the door with your fists, screaming for help! "); WriteLine(" 3) Go back"); WriteLine(" 4) Open backpack\n"); string inputOption = ReadLine(); Clear(); switch (inputOption) { case "1": WriteLine("\n Oh no....it's locked! Can't open it."); ReadLine(); BasementDoor(); break; case "2": //Sending player to Game Over WriteLine("\n What's that sound? Is someone coming?"); ReadLine(); WriteLine("\n Yes, you can hear footsteps getting closer and suddenly you hear the door open and someone is entering the room..."); WriteLine(" But it's not to help you..."); ReadLine(); gameSettings.GameOver(); break; case "3": basement.BasementView(); break; case "4": //Runs the open backpack functions and handling the response with if-statements //If the correct object is choosen you move on in the game string backpackResponse = foundObjects.OpenBackpack(); if (backpackResponse == "back") { BasementDoor(); } else if (backpackResponse == "BasementDoor") { Clear(); WriteLine("\n Yeah, the door is now open, let´s se what's on the other side...."); ReadLine(); foundObjects.DeleteObject("Keycard"); gameSettings.EndGame(); } else { Clear(); WriteLine("\n Naahh...that didn't work"); ReadLine(); BasementDoor(); } break; default: WriteLine(" What are you trying to do?..Not a correct input"); ReadLine(); input = false; break; } } while (input == false); }