Exemple #1
0
    // Called when the node enters the scene tree for the first time.
    public override void _Pressed()
    {
        GetUIEvent guiei = new GetUIEvent();

        guiei.uiState = UIState.WAIT_HUD;
        guiei.FireEvent();
    }
Exemple #2
0
    //=================================================================================================================

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        //The events from the UI
        GetUIEvent.RegisterListener(GetUIInput);
        //Regestiring the events for the game states
        RunEvent.RegisterListener(RunPressed);
        WinEvent.RegisterListener(WinGame);
        DeathEvent.RegisterListener(LoseGame);

        Load();
        Init();
    }
Exemple #3
0
 private void GetUIInput(GetUIEvent guiei)
 {
     if (guiei.uiState == UIState.WAIT_HUD)
     {
         //Change the game state for the game mechanics loop
         gameStateManager.ChangeState(gameWaitState);
     }
     else if (guiei.uiState == UIState.PROGRAMMING_HUD)
     {
         //Change the game state for the game mechanics loop
         gameStateManager.ChangeState(gameProgramState);
     }
 }
Exemple #4
0
 public override void _ExitTree()
 {
     gameStateManager.Exit();
     RunEvent.UnregisterListener(RunPressed);
     GetUIEvent.UnregisterListener(GetUIInput);
 }