Original Post
i want to have a spaceship, that moves left when u press left, up when up is pressed, etc., but i want to have a maxium speed limit. right now i use
x_pos += x_vel
y_pos += y_vel
x_vel += x_accel
y_vel += y_accel
if (left_key_pressed)
{
if (x_vel > -10.0f) {x_vel += time_passed / 10.0f}
if (x_vel < -10.0f) {x_vel = 10.0f}
}
and same thing for other keys. but that makes the speed limit too sudden. i want your acceleration to *slowly* slow down to 0 as your speed becomes close to 10.0f. also, it has to work with negative and positive initial speeds. thank you for any help,
shurcool.