Пример #1
0
 public void HandleInput(InputState input, GameTime gameTime)
 {
     for (int i = 0; i < 4; i++)
         movement[i] = false;
     if (input.IsHoldDown())
     {
         position.Y += posDelta;
         movement[0] = true;
     }
     if (input.IsHoldUp())
     {
         position.Y -= posDelta;
         movement[1] = true;
     }
     if (input.IsHoldLeft())
     {
         position.X -= posDelta;
         movement[2] = true;
     }
     if (input.IsHoldRight())
     {
         position.X += posDelta;
         movement[3] = true;
     }
     boundingBox.X = (int)Position.X;
     boundingBox.Y = (int)Position.Y;
     if (input.IsUseButtonPressed())
         ((PlayableMainGameScreen)OwnerScreen).PlayerInteraction(gameTime);
 }