You want to make sure that thrust is limited to between 0 and 10, instead of subtracting 0.01 if it's below 0
Is this any better:
sync on
sync rate 40
hide mouse
rem make ship
`make object sphere 1,5
make object cone 1,5
xrotate object 1,90
fix object pivot 1
remstart
load object "spaceship.x",1
scale object 1,100,1,100
position object 1,0,0,0
remend
rem variables
if lives#=0
lives#=3
endif
if level#=0
level#=1
endif
balla#=90
position camera 0,50,0
point camera 0,0,0
do
if upkey()=1 then thrust#=thrust#+0.1
if thrust#>10 then thrust#=10.0
if upkey()=0 then thrust#=thrust#-0.05
if thrust#<0 then thrust#=0.0
position object 1,ballx#,0,ballz#
yrotate object 1,balla#
ballx#=newxvalue(ballx#,balla#,thrust#)
ballz#=newzvalue(ballz#,balla#,thrust#)
if leftkey()=1 then balla# = balla# - 5
if rightkey()=1 then balla# = balla# + 5
balla#=wrapvalue(balla#)
sync
if ballx#>40 then ballx#=-39
if ballx#<-40 then ballx#=39
if ballz#>30 then ballz#=-29
if ballz#<-30 then ballz#=29
loop
It still isn't perfect asteroids code since the angle still effects the direction mid flight. If you wanted to get over this you would have to store seperate thrust values for the x and z directions, and adjust them both when the up key is pressed.