Use separate variables (vx# and vy#) for keeping track of the player's velocity. While the player accellerates, add a small amount to them (vx=vx+sin(dir)*speed:vy=vy+cos(dir)*speed). Every update, add the velocity to the position (x=x+vx:y=y+vy). Thusly, the player has control over his accelleration, but not his position (unless he engages his emergency random teleport device, which I believe all asteroids ships are equipped with during factory assembly.)
If you decide that there's air in space, you can multiply the velocity by a number close to 1 (try .9) to decay the velocity and achieve drag.
Happy hunting!
If you decide that there's air in space, you can multiply the velocity by a number close to 1 (try .9) to decay the velocity and achieve drag.
Happy hunting!