Okay so i took your code and implemented it on my project until i finally, Finally found the error xD. took about 30 mins straight lol.
The problem is in this part
bool isValidLevelNumber = (input == "1" || input == "2" || input == "3");
if (isValidLevelNumber)
{
level = int.Parse(input);
StartGame();
}
if (input == "Menu")
{
ShowMainMenu();
currentScreen = Screen.MainMenu;
}
else if (input == "Method0901")
{
Terminal.WriteLine("Follow Method0901 on twitch: twitch.tv/METHOD0901");
currentScreen = Screen.EasterEgg;
}
else if (currentScreen == Screen.Password)
{
Password();
}
else
{
Terminal.WriteLine("Please make a valid selection.");
}
What happens here is that you check if the level is correct and if so you start the game but you don’t stop there. the code continues because he finds another if condition so it’s similar to
if(a == b) print(1);
if(b == c) print(2);
what will happen is that you’ll find in the console the output “12” have occurred because the code reads the whole block. but if we change it to
if(a == b) print(1);
else if(b == c) print(2);
you will find the first one which is “1” and print it.
Relating this to your code, you start the game but the code keeps going to the next If-else block which is from line 48~68… so it takes the same input and checks for both parts.
The solution is simply change line 48 from
if (input == "Menu")
to
else if (input == "Menu")
i know this was a lot to take in but i hope it was simple enough, Good luck throughout the project ")