This should get you going the right direction. Typed straight into replybox, so, untested.
Const KEY_LEFT = 203 Const KEY_RIGHT = 205 Repeat cls If KeyDown(KEY_LEFT) xSpeed = xSpeed - 0.1 EndIf If KeyDown(KEY_RIGHT) xSpeed = xSpeed + 0.1 EndIf If not KeyDown(KEY_LEFT) and xSpeed < 0 xSpeed = xSpeed + 0.1 EndIf If not KeyDown(KEY_RIGHT) and xSpeed > 0 xSpeed = xSpeed - 0.1 EndIf if Abs(xSpeed) < 0.1 xSpeed = 0 endif If xSpeed < -5 then xSpeed = -5 If xSpeed > 5 then xSpeed = 5 x = x + xSpeed DrawImage ship,x,y flip Forever