public class Hacker : MonoBehaviour {
string level; //game state
void Start ()
{
ShowMainMenu ();
}
void ShowMainMenu ()
{
Terminal.ClearScreen();
Terminal.WriteLine("Welcome...");
Terminal.WriteLine("There isn't much time,");
Terminal.WriteLine("you must hack these");
Terminal.WriteLine("secure systems to learn");
Terminal.WriteLine("more about the Truth.");
Terminal.WriteLine("Hack the NYPD");
Terminal.WriteLine("Hack the FBI");
Terminal.WriteLine("Hack the NSA");
Terminal.WriteLine("Make your choice.");
}
void OnUserInput(string input)
{
if (input == "menu")
{
ShowMainMenu ();
}
else if (input == "NYPD")
{
level = "NYPD";
StartGame();
}
else if (input == "FBI")
{
level = "FBI";
StartGame();
}
else if (input == "NSA")
{
level = "NSA";
StartGame();
}
else if (input == "exit")
{
Terminal.WriteLine("There is no exit, without Truth");
}
else
{
Terminal.WriteLine("Response Invalid");
}
}
void StartGame()
{
Terminal.WriteLine("Entering {0} mainframe." level);
}
}
Hey all, after watching āmember variables to hold stateā Iāve tried to use words with string for tracking the level rather than int single digits as it fits the theme of my game better, i had got it to work, but when i went back to change something else in the āenumerating our game statesā tutorial its coming up with errors under WRITELINE and LEVEL on the final line. What have i missed or messed up?