title: Move sprite in the direction of the value from the rotation?
body: <p>I'm new to XNA and I'm building an Asteroids game. I have some problems to get my spaceship to move forward in the direction I want. When I press the arrow up key, I want the engine to start and move the space ship in the same directions as the rotation of the spaceship? Help is preciated! I add the subclass that is my spaceship. The Draw method and its variables are in the main class. I'm not sure what to have in the EngineOn method?</p>
  
  <pre><code> class Spaceship: GameObject
  {
  
      // Konstruktor
      public Spaceship(Texture2D texture, Vector2 position): base(texture, position)
      {
  
      }
  
      public override void Update()
      {
          direction = new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation));
          position += direction * speed;  //position = position + direction
          //base.Update();
      }
  
      // Metod som beräknar rymdskeppets färd i riktningen
      public void EngineOn()
      {
          Update();
      }
  
      // Metod som beräknar rymdskeppets rotation motsols
      public void RotateLeft()
      {
          rotation -= rotationSpeed;
      }
  
      // Metod som beräknar rymdskeppets rotation medsols
      public void RotateRight()
      {
          rotation += rotationSpeed;
      }
  
      // Metod som beräknar bana för avlossade skott
      public void Fire()
      {
  
      }
  }
  </code></pre>