Level2location for the welcome message!

I’m pretty proud of this that just occurred to me. At the top in the game configuration data I added this array:

string[] level2location = { "Waffleburger", "Tech Wizzy Wig, LLC", "Obscuritus University" };

The reason is that the flavor text of my main menu doesn’t reference level 1, 2, or 3 but the actual names of the businesses.

Then in the StartGame function, I added the following:

  void StartGame()
    {
        currentScreen = Screen.Password;
        string location = level2location[level-1];
        Terminal.WriteLine("You have chosen to hack " + location);
        Terminal.WriteLine("Please enter the password:");
    }

This declares a new string variable of location that is equal to the level -1 (because the indexes start at 0). Then I reference the new variable location in the Terminal.WriteLine.

Result:

image

2 Likes

Privacy & Terms