title: XNA sprite movement gone wrong
body: <p>Hy everyone, so first off all, here is the image of my sprite:
  <a href="https://i.stack.imgur.com/teOEV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/teOEV.png" alt="enter image description here"></a></p>
  
  <p>I scaled it down in my game so its not that big in-game.</p>
  
  <p>So anyway my desired result of the code below:</p>
  
  <pre><code>protected override void Update(GameTime gameTime)
      {
          // Allows the game to exit
          if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
              this.Exit();
  
          spritePos = spriteVelocity + spritePos;
          spriteR = new Rectangle((int)spritePos.X, (int)spritePos.Y, spriteT.Width, spriteT.Height);
          spriteOrigin = new Vector2(spriteR.Width/2, spriteR.Height / 2);
  
          if (Keyboard.GetState().IsKeyDown(Keys.Right)) rotation += 0.1f;
          if (Keyboard.GetState().IsKeyDown(Keys.Left)) rotation -= 0.1f;
  
          if (Keyboard.GetState().IsKeyDown(Keys.Up))
          {
              spriteVelocity.X = (float)Math.Cos(rotation) * tangentialVelocity;
              spriteVelocity.Y = (float)Math.Sin(rotation) * tangentialVelocity;
          } else if (spriteVelocity != Vector2.Zero)
          {
              float i = spriteVelocity.X;
              float j = spriteVelocity.Y;
  
              spriteVelocity.X = i -= friction * i;
              spriteVelocity.Y = j -= friction * j;
          }
  
          base.Update(gameTime);
      }
  </code></pre>
  
  <p>and then Draw method:</p>
  
  <pre><code>protected override void Draw(GameTime gameTime)
      {
          GraphicsDevice.Clear(Color.CornflowerBlue);
  
          spriteBatch.Begin();
  
          foreach(Bushes bush in bushes)
          {
              bush.Draw(spriteBatch);
          }
  
          player.Draw(spriteBatch);
          spriteBatch.Draw(spriteT, spritePos, null, Color.White, rotation, spriteOrigin, 0.1f, SpriteEffects.None, 0f);
          spriteBatch.End();
  
          base.Draw(gameTime);
      }
  </code></pre>
  
  <p>is that when I press 'Up' arrow this little rocket should go into direction in whis it is pointing (becouse I can rotate it with Left and Right arrow to have it pointed where desired), but the result of this code is that when I press Up arrow the sprite moves to the right at first, and when its rotated it doesnt go where its pointed but kinda sideways :/</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>PS. all those variables that arent declared and initialized in code are global variables and initialized in Initialize() and LoadContent() methods :/</p>