Esempio n. 1
0
 public override void Update(GameTime gameTime)
 {
     if (Selected)
     {
         if (inputManager.ActionWasJustPressed("MoveLeft"))
         {
             if (volume > 0.0f)
             {
                 volume -= 0.1f;
                 volume  = (float)Math.Round(volume, 1);
             }
             OnClick?.Invoke(this, new EventArgs());
         }
         else if (inputManager.ActionWasJustPressed("MoveRight"))
         {
             if (volume < 1.0f)
             {
                 volume += 0.1f;
                 volume  = (float)Math.Round(volume, 1);
             }
             OnClick?.Invoke(this, new EventArgs());
         }
         if (volume < 0.1f)
         {
             volume = 0.0f;
         }
         if (volume > 1.0f)
         {
             volume = 1.0f;
         }
         if (inputManager.ActionWasJustPressed("Accept"))
         {
         }
     }
 }
Esempio n. 2
0
 protected void Navigate()
 {
     if (inputManager.ActionWasJustPressed("MoveUp"))
     {
         currentlySelectedButton = (currentlySelectedButton - 1) % buttons.Count;
         if (currentlySelectedButton == -1)
         {
             currentlySelectedButton = buttons.Count - 1;
         }
     }
     else if (inputManager.ActionWasJustPressed("MoveDown"))
     {
         currentlySelectedButton = (currentlySelectedButton + 1) % buttons.Count;
     }
 }
Esempio n. 3
0
 public virtual void PrepareMove(GameTime gameTime)
 {
     if (MoveableBodyState != MoveableBodyStates.Dead && MoveableBodyState != MoveableBodyStates.Attacking)
     {
         if (InputManager.ActionIsPressed("MoveRight"))
         {
             MoveRight();
         }
         else if (InputManager.ActionIsPressed("MoveLeft"))
         {
             MoveLeft();
         }
         if (InputManager.ActionIsPressed("MoveUp"))
         {
             if (CanJump())
             {
                 Jump();
             }
         }
         if (InputManager.ActionWasJustPressed("Attack"))
         {
             Attack();
         }
     }
 }
Esempio n. 4
0
 public override void Update(GameTime gameTime)
 {
     if (Selected)
     {
         if (inputManager.ActionWasJustPressed("Accept"))
         {
             OnClick?.Invoke(this, new EventArgs());
         }
     }
 }
Esempio n. 5
0
        public override void Update(GameTime gameTime)
        {
            if (inputManager.ActionWasJustPressed("Back"))
            {
                _game.ChangeState(new ConfirmExitState(_game, _graphicsDevice, _content));
                return;
            }
            if (Champion.GetInstance().health <= 0)
            {
                _champ.level = 1;

                _champ.NotifyObservers();
                _game.ChangeState(new NewRecordState(_game, _graphicsDevice, _content));
                return;
            }

            Champion.GetInstance().Update();
        }