Beispiel #1
0
    public override void _Ready()
    {
        //Referencing all the displays in the UI node for later use
        menu        = GetNode <VBoxContainer>("Menu");
        wait        = GetNode <VBoxContainer>("Wait");
        programming = GetNode <Node2D>("Programming");
        run         = GetNode <Node2D>("Run");
        win         = GetNode <Node2D>("Win");
        lose        = GetNode <Node2D>("Lose");

        SendUIEvent.RegisterListener(ChangeState);
        SendProgramEvent.RegisterListener(GetProgram);
    }
Beispiel #2
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        //Pre load the scenes for the game
        playerScene   = ResourceLoader.Load("res://Scenes/Player.tscn") as PackedScene;
        mapScene      = ResourceLoader.Load("res://Scenes/Map.tscn") as PackedScene;
        enemyScene    = ResourceLoader.Load("res://Scenes/Enemy.tscn") as PackedScene;
        artifactScene = ResourceLoader.Load("res://Scenes/Artifact.tscn") as PackedScene;
        uiScene       = ResourceLoader.Load("res://Scenes/UI.tscn") as PackedScene;
        //The UI of the game
        ui = uiScene.Instance();
        AddChild(ui);

        SendUIEvent.RegisterListener(StartGame);
        DeathEvent.RegisterListener(LoseGame);
        WinEvent.RegisterListener(WinGame);
    }