Here's some movement code from a space game I was working on:
if (ships(index).behavior$ = "HUMAN")
left = leftKey()
right = rightKey()
up = upKey()
moveX = mouseMoveX()
moveY = mouseMoveY()
endif
`adjust ship angle
ships(index).zrotation# = ships(index).turn#*300*(left-right) *elapsed/fps60
ships(index).acceleration# = ships(index).accel#*up *elapsed/fps60
inc ships(index).xrotation#, -moveY*ships(index).turn# *elapsed/fps60
inc ships(index).yrotation#, moveX*ships(index).turn# *elapsed/fps60
`set the angle of the ship using EZrotate
EZro_Set object angle x(id), object angle y(id), object angle z(id)
ships(index).xrotation# = ships(index).xrotation# * ships(index).tdampen#
EZro_LX ships(index).xrotation#
ships(index).yrotation# = ships(index).yrotation# * ships(index).tdampen#
EZro_LY ships(index).yrotation#
EZro_LZ ships(index).zrotation#
rotate object id, EZro_GetX(), EZro_GetY(), EZro_GetZ()
`get where the ship is pointing (to calculate thrust)
move object id, 1
x# = object position x(id)
y# = object position y(id)
z# = object position z(id)
move object id, -1
`calculate thrust, adjust velocity, and move ship accordingly
set vector3 v3_global1, x# - object position x(id), y# - object position y(id), z# - object position z(id)
normalize vector3 v3_global1, v3_global1
multiply vector3 v3_global1, ships(index).acceleration#
add vector3 ships(index).v_velocity, ships(index).v_velocity, v3_global1
multiply vector3 ships(index).v_velocity, ships(index).dampen#
moveObject(id, x vector3(ships(index).v_velocity)/4.0, y vector3(ships(index).v_velocity)/4.0, z vector3(ships(index).v_velocity)/4.0)