Ejemplo n.º 1
0
 void Update()
 {
     if (currentMenuState != null)
     {
         currentMenuState.Update();
     }
 }
Ejemplo n.º 2
0
        public void Update()
        {
            switch (Globals.activeState)
            {
            case Globals.enGameStates.SPLASH:
                splashState.Update();
                break;

            case Globals.enGameStates.MENU:
                menuState.Update();
                break;

            case Globals.enGameStates.GAME:
                gameState.Update();
                break;

            case Globals.enGameStates.GAMEOVER:
                gameOverState.Update();
                break;

            case Globals.enGameStates.WIN:
                winState.Update();
                break;

            case Globals.enGameStates.EXIT:
                Globals.exit = true;
                break;
            }
        }
Ejemplo n.º 3
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            Input.Update(gameTime);

            switch (_gameState)
            {
            case GameStateEnum.Game:
                if (Input.GetInput(Inputs.QuickLoad, InputState.Pressed))
                {
                    if (LoadSession("quicksave.sav"))
                    {
                        Hud.Chat("Loading from quick save");
                        return;
                    }
                }
                else if (Input.GetInput(Inputs.QuickSave, InputState.Pressed))
                {
                    SaveSession("quicksave.sav");
                    Hud.Chat("Quick saving...");
                }

                if (Session != null)
                {
                    Session.Update(gameTime);
                }

                Hud.Update(gameTime);


                if (Input.GetInput(Inputs.Pause, InputState.Pressed))
                {
                    var g = GuiManager.GetGuiOfType <Gui.MiniMenu>();
                    if (g == null)
                    {
                        GuiManager.Add(new Gui.MiniMenu());
                    }
                    else
                    {
                        g.Closing = true;
                    }
                }

                GuiManager.Update(gameTime);
                break;

            case GameStateEnum.Menu:
                MenuState.Update(gameTime);
                break;

            case GameStateEnum.Intro:
                Intro.Update(gameTime);
                break;
            }

            Console.Update(gameTime);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Allows the game to run logic such as updating the world,
 /// checking for collisions, gathering input, and playing audio.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Update(GameTime gameTime)
 {
     if (menuState)
     {
         menu.Update();
     }
     else
     {
         if (!pausedState && !gameOverState)
         {
             Feedback.Update(level, gameTime);
             level.Update(gameTime, hidden);
             GamePadControls.UpdateInput();
             camera.Update(level.Mario.SpritePosition, Level.ScreenWidth, Level.ScreenHeight, hidden);
             DeadRestartOrGameOver(gameTime);
             WonGame();
         }
         KeyBoardControls.UpdateInput();
     }
 }
Ejemplo n.º 5
0
 private void Update()
 {
     returnedState = currentState.Update(this, Time.deltaTime);
 }