Esempio n. 1
0
        // The update function is the logical loop, here all logic goes.
        public override void Update()
        {
            // Loop through all of the buttons, and check what button is being pressed,
            // Act accordingly.
            for (int i = 0; i < uiElements.Length; i++)
            {
                if (uiElements[i].IsClicked())
                {
                    switch (uiElements[i].ID)
                    {
                    case 0:     // New Game
                        StageHandler.LoadStage(new MainGame("Game"));
                        break;

                    case 2:     // Coop
                        if (StageHandler.StageExists("Coop"))
                        {
                            StageHandler.SetCurrentStage("Coop");
                        }
                        else
                        {
                            StageHandler.LoadStage(new CoopMenu("Coop"));
                        }
                        break;

                    case 5:     // Exit
                        Raylib.CloseWindow();
                        Environment.Exit(1);
                        break;
                    }
                }
            }
        }