title: Moving Sprite Diagonally
body: <p>So when I press <kbd>a</kbd> <kbd>s</kbd> <kbd>w</kbd> <kbd>d</kbd> in my keyboard sprite moves but it doesn't want to go diagonal its like you can only press 1 button at a time here is my code. </p>
  
  <p>What I want it to do is when you say for example press <kbd>w</kbd> and <kbd>d</kbd> it goes north east. Same goes for other keys</p>
  
  <pre><code>class Player
  {
      Texture2D playertexture;
      Vector2 playerposition;
  
  
  
      public Player(Vector2 playerposition, Texture2D playertexture)
      {
          this.playertexture = playertexture;
          this.playerposition = playerposition;
      }
  
      public void Update(GameTime gameTime)
      {
          if (Keyboard.GetState().IsKeyDown(Keys.D)) //right
          {
              playerposition.X += 1;
  
          }
          else if (Keyboard.GetState().IsKeyDown(Keys.A)) //left
          {
              playerposition.X -= 1;
  
          }
          else if (Keyboard.GetState().IsKeyDown(Keys.W)) //up
          {
              playerposition.Y -= 1;
  
          }
          else if (Keyboard.GetState().IsKeyDown(Keys.S)) //down
          {
              playerposition.Y += 1;
  
          }
  
      }
      public void Draw(SpriteBatch spriteBatch)
      {
  
          spriteBatch.Draw(playertexture, playerposition, Color.White);
  
  
      }
  }
  </code></pre>