Exemplo n.º 1
0
 public override void Update(float elapsed)
 {
     CurrentActionState.Update(elapsed);
     CurrentPowerState.Update(elapsed);
     Mario.Update(elapsed);
     Sprite.Position = Mario.Position;
     base.Update(elapsed);
 }
Exemplo n.º 2
0
 protected override void Update(GameTime gameTime)
 {
     if (atMainMenu)
     {
         home.Update();
     }
     else
     {
         pauser.Update();
         trophy.Update();
         if (!pauser.isPaused())
         {
             cheats.Update();
             if (Mario.Health() == MarioStateMachine.MarioHealth.Dead)
             {
                 countToRestart--;
             }
             if (countToRestart == 0)
             {
                 countToRestart = 100;
                 changer.changeLevel();
                 LevelChanger.SetBGMusic(curLevel);
             }
             if (EnableControls)
             {
                 keyboard.Update(gameTime);
                 gamepad.Update(gameTime);
                 mouse.Update(gameTime);
                 RumbleHelper.Update(gameTime);
             }
             if (!changingLevel)
             {
                 Mario.Update(gameTime);
                 parser.Update();
             }
             MainCamera.Update(Mario);
             load.Update();
             UI.Update(gameTime);
             if (!timerEnabled)
             {
                 UI.StopTimer();
             }
             parser.ToggleCastle(toggleCastle);
             base.Update(gameTime);
         }
         else
         {
             pauser.Update();
             if (EnableControls)
             {
                 keyboard.Update(gameTime);
                 gamepad.Update(gameTime);
                 mouse.Update(gameTime);
                 RumbleHelper.Update(gameTime);
             }
         }
     }
 }