Code:
...
...
void Object::Update(float timeDelta)
{
m_vecVel += m_vecAcceleration * timeDelta;
m_vecPos += m_vecVel * timeDelta;
//Bounce off sides of screen
if (m_vecPos.x <= Screen.left || m_vecPos.x >= Screen.right)
{
m_vecVel.x = -m_vecVel.x;
}
if (m_vecPos.y <= Screen.top || m_vecPos.y >= Screen.bottom)
{
m_vecVel.y = -m_vecVel.y;
}
}
void Object::Thrust(float units)
{
m_vecAcceleration.x += cosf(m_vecRotation.z) * units;
m_vecAcceleration.y += sinf(m_vecRotation.z) * units;
}
void Object::RotateLeft(float units,float timeDelta)
{
m_vecRotation.z += units * timeDelta;
}
void Object::RotateRight(float units,float timeDelta)
{
m_vecRotation.z -= units * timeDelta;
}
...
...
This should do what you want. Note that mass is not taken into effect nor have I computed any mass moment of inertia's, etc.