I'm rotating a sprite using the following, but when the spaceship, which is circular, is facing towards the left side of the screen and I press the thrust key it slows down? Any help? Velocity, acceleration and positon are all vectors. Can't think of anymore code you may need!
void drawObject() {
...
...
//Acceletion moves the spaceship across the screen
velocity += acceleration * pTheGameTimer->mdFrameTime;
//Adjust bearing angle according to the above key press
velocity.setBearing((dAngle/360*6.282), velocity.magnitude());
//Move helicopter based upon velocity
position += velocity * pTheGameTimer->mdFrameTime;
}
Bookmarks