My Code so far

The Lectures have been great to help me understand how C# works.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Hacker : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {   
        
        ShowMainMenu();
        
    }

    void ShowMainMenu()
    {   
        
        Terminal.ClearScreen();
        Terminal.WriteLine("Hello Hacker");
        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("Press 3 for the Pentagon");
        Terminal.WriteLine("Enter your Selection.");
    }

    void OnUserInput(string input) 
    {
        if (input == "menu")
        {
            ShowMainMenu();
        }

        else if (input == "1")
        {
            Terminal.WriteLine("You chose Level 1 ");
        }

        else if (input == "2")
        {
            Terminal.WriteLine("You chose Level 2 ");
        }

        else if (input == "3")
        {
            Terminal.WriteLine("You chose Level 3 ");
        }

        else if (input == "007")
        {
            Terminal.WriteLine("The name's Bond, James Bond.");
        }

        else 
        {
            Terminal.WriteLine("Please choose a level or type 'menu' to return to the main menu");
        }
    }
    

    
}
1 Like

Great job with your code!

Privacy & Terms