My shot at Terminal Hacker

Themes for each difficulty:
Easy - Hacking into an unencrypted conversation
Medium - Hacking into a work PC
Hard - Hacking your local PD
Godly - Hacking into the NSA archives

Words for each difficulty:
Easy - Map, Rock, Tip, Maze, Hey
Medium - Hello, Pasta, Earth, Crust, Koala
Hard - Cricket, Yodel, Broccoli, Knight, House
Godly - Subterfuge, Scavenger, Tubular, Hazardous, Uranium

Welcome Screen:

Approach to storing passwords:

    int level;
    enum Screen { MainMenu, Password, Win };
    Screen currentScreen = Screen.MainMenu;

    string[][] passwordBank = {
        new string[] { "map", "rock", "tip", "maze", "hey" }, // easy
        new string[] { "hello", "pasta", "earth", "crust", "koala" }, // medium
        new string[] { "cricket", "yodel", "broccoli", "knight", "house" }, // hard
        new string[] { "subterfuge", "scavenger", "tubular", "hazardous", "uranium" } // godly
    };
    string currentPassword;

    void GetPassword() {
        int randomIndex = UnityEngine.Random.Range(0, passwordBank[level-1].Length);
        currentPassword = passwordBank[level-1][randomIndex];
        print(currentPassword);
    }

I found that using string instead of string[,] to declare a 2d array is better when you also need access to a specific row of the array. Its known as a jagged array. I wanted this so that I didn’t have to adjust anything else when I add more passwords into the password bank.

*Reward Screens: *

Link to my version of the game: https://sharemygame.com/@PipSharp/terminal-hacker-test-upload
(Some of the ASCII art got messed up while converting to webGL. Sorry about that)

Privacy & Terms