protected override void Update(GameTime gameTime)
        {
#if DEBUG
            PreviousKeyboard = CurrentKeyboard;
            CurrentKeyboard  = Keyboard.GetState();
            if (CurrentKeyboard.IsKeyDown(Keys.R) && PreviousKeyboard.IsKeyUp(Keys.R))
            {
                StateManager.Reload();
                AdvanceSlowly = false;
            }

            if (CurrentKeyboard.IsKeyDown(Keys.Pause) && PreviousKeyboard.IsKeyUp(Keys.Pause))
            {
                AdvanceSlowly = !AdvanceSlowly;
            }

            if (!AdvanceSlowly)
            {
                StateManager.Update(gameTime);
            }
            else
            {
                if (CurrentKeyboard.IsKeyDown(Keys.Right) && PreviousKeyboard.IsKeyUp(Keys.Right))
                {
                    StateManager.Update(gameTime);
                }
            }
#else
            StateManager.Update(gameTime);
#endif
            base.Update(gameTime);
        }
Exemple #2
0
 private void CheckJump()
 {
     if (!IsOnConveyor || IsWindingUp)
     {
         return;
     }
     if (CurrentKeyboard.IsKeyDown(Input.Jump) && PreviousKeyboard.IsKeyUp(Input.Jump) && AliveTimer > 0)
     {
         AnimationManager.Play(Animations["standing"]);
         AudioManager.PlayEffect(ContentManager.JumpSoundEffect);
         JumpLandingAnimation();
         IsJumping        = true;
         Speed            = Vector2.UnitY * JUMP_VELOCITY;
         FallAcceleration = 0;
         IsOnConveyor     = false;
     }
 }