Quote: " I can't seem to get the movement to work because it goes off the screen as soon as I press a button. "
Probably because you are moving it too far each sync. You've set the sync rate to 60 so the main loop is executed about 60 times a second. The other thing to remember is that when you press a key the PC will perform the checks each loop so your variables get updated each loop till you release the key which could be several times through the loop.
The simplest solution is to make smaller adjustments to the angle and thrust. Before doing that though, just try changing the sync rate to 15. That will slow things down a bit and you will then see how your program is working, albeit more slowly, and it'll be easier for you to decide which things need to be adjusted. Once you've got the main movement fixed you can then run the game at full speed using sync rate 60.
If you want the angle and position to update only once when you press a key you'll need to add some variables and logic to detect when a key has been released. You'll then need to press a key multiple times if you want the angles, etc to be updated several times. In this case you might prefer your present method though (I probably would) in which case you'll need to do what I suggested above.
You might like to think about this line:
MOVE SPRITE 1, p.angle + p.thrust
Is that really what you intended? Why is the angle in there?
Have a look at this code where I've made a few changes to your sample code. For example, I've put the ship in the middle of the screen initially to make it easier to see what's happening. You will obviously need to change a few things but I hope this will get you started.
SYNC ON : SYNC RATE 60 : SET DISPLAY MODE 800, 600, 32
TYPE LanderType
x AS INTEGER
y AS INTEGER
angle AS FLOAT
speed AS FLOAT
thrust AS FLOAT
orx AS INTEGER
ory AS INTEGER
ENDTYPE
GLOBAL p AS LanderType
p.x = 400 `12.0
p.y = 300 `580.0
p.orx = 16
p.ory = 16
p.angle = 0.0
p.thrust = 0.0
p.speed = 0.0
grav = 1
LOAD IMAGE "p_ship.bmp", 1
LOAD IMAGE "b_bg.dds", 2
LOAD IMAGE "rock.dds", 3
SPRITE 1, p.x, p.y, 1
SPRITE 2, 0, 0, 2
SPRITE 3, -500, 500, 3
SET SPRITE PRIORITY 1, 1
OFFSET SPRITE 1, p.orx, p.ory
DO
CLS
GetInput()
DrawGround( 0, 580, 600, 580 )
GOSUB CheckCollision
GOSUB UpdatePlayer
SYNC
LOOP
CheckCollision:
IF p.x > 800 THEN p.x = 800
IF p.x < 0 THEN p.x = 0
IF p.y > 600 THEN p.y = 600
IF p.y < 0 THEN p.y = 0
RETURN
UpdatePlayer:
IF p.thrust > 0 AND UPKEY() = 0 THEN DEC p.thrust, 0.05 `2
IF p.thrust < 0 THEN p.thrust = 0
DEC p.thrust, grav
MOVE SPRITE 1, -p.thrust
`MOVE SPRITE 1, p.angle + p.thrust
RETURN
FUNCTION GetInput()
IF UPKEY()
INC p.thrust, 0.5 `1.2
ENDIF
IF LEFTKEY()
DEC p.angle, 1.0 `4
ROTATE SPRITE 1, p.angle
ENDIF
IF RIGHTKEY()
INC p.angle, 1.0 `4
ROTATE SPRITE 1, p.angle
ENDIF
ENDFUNCTION
FUNCTION DrawGround( x1, y1, x2, y2 )
LINE x1, y1, x2, y2
ENDFUNCTION