i am try to make a mini password game to learn c# on a course and i keep getting this error when im try to make the game read the password. here is the code anything i need to get rid of? or maybe add? if this helps im using unity as my engine. thanks
// Game state
int level;
enum Screen { MainMenu, Password, Win };
Screen currentScreen;
string password;
// Use this for initialization
void Start()
{
ShowMainMenu();
}
void ShowMainMenu()
{
currentScreen = Screen.MainMenu;
Terminal.ClearScreen();
Terminal.WriteLine("What would you like to hack into?");
Terminal.WriteLine("Press 1 for the local library");
Terminal.WriteLine("Press 2 for the police station");
Terminal.WriteLine("Enter your selection:");
}
void OnUserInput(string input)
{
if (input == "menu")
{
ShowMainMenu();
}
else if (currentScreen == Screen.MainMenu)
{
Runmainmenu(input);
}
else if (currentScreen == Screen.Password)
{
Checkpassword(input);
}
}
void CheckPassword(string input)
{
if (input == password)
{
checkpassword(input);
Terminal.WriteLine("Sorry, wrong password!");
}
else
{
Terminal.WriteLine("WELL DONE!");
}
}
private void checkpassword(string input)
{
Checkpassword(input);
}
private void Runmainmenu(string input)
{
{
if (input == "1")
{
level = 1;
password = "book";
StartGame();
}
if (input == "2")
{
level = 2;
password = "handcuffs";
StartGame();
}
else if (input == "007")
{
Terminal.WriteLine("Please select a level Mr Bond!");
}
else
{
}
}
}
void StartGame()
{
currentScreen = Screen.Password;
Terminal.WriteLine("You have chosen level " + level);
Terminal.WriteLine("Please enter your password: ");
}
void Checkpassword(string input)
{
checkpassword(input);
}
private void runmainmenu(string input)
{
runmainmenu(input);
}
string GetDebuggerDisplay()
{
return ToString();
}