This is what CornedBee and Bubba was talking about.
Store your positions, velocities and forces in vectors, that is something like
(or create a vector class with operator overloading.)
Let the first value in the vector be the x value and the second value be the y value.
Then your position update function would be something like this:
Code:
// angle is the direction of the object in radians.
force[0] = cos(angle) * thrust;
force[1] = sin(angle) * thrust;
for (i = 0; i < 2; i++) {
// mass is a float with the mass of the object and time_step is the time between each frame.
velocity[i] += mass * force[i] * time_step;
position[i] += velocity[i] * time_step;
}
And then you just draw the object at its new position.
Try searching google for vector class implementations (most are 3d but that doesn't matter).
Good luck.
/f