THAT problem is now sorted, but its created a new one which i REALLY dont understand, here is the ENTIRE code of the game:
`setup
sync on
sync rate 0
set display mode 800,600,16
`load crap
load object "asteroidship.3ds",1
load image "starfield.bmp",10
load image "asteroid.bmp",20
autocam off
`position the camera
playerx#=object position x(1)
playery#=object position y(1)
playerz#=object position z(1)
position camera playerx#,playery#,playerz#-100
`make a background
texture backdrop 10
`position the spaceship in the middle of the screen
position object 1,0,0,0
`position the camera
position camera 0,0,-150
`point the ship into the distance
point object 1,0,0,100
xrotate object 1,13
`move ship
do
if rightkey()=1 then xpos#=xpos#+0.6
if leftkey()=1 then xpos#=xpos#-0.6
if upkey()=1 then ypos#=ypos#+0.6
if downkey()=1 then ypos#=ypos#-0.6
position object 1,xpos#,ypos#,zpos#
if xpos#>120 then position object 1,119,ypos#,0
if xpos#<-120 then position object 1,-119,ypos#,0
if ypos#>40 then position object 1,xpos#,38,0
if ypos#<-130 then position object 1,xpos#,-129,0
gosub creater
sync
loop
`make asteroids
creater:
do
load object "asteroid.3ds",2
texture object 2,20
position object 2,rnd(200)-100,rnd(100)-200,500
gosub mover
sync
loop
return
`move asteroids
mover:
do
ax#=object position x(2)
ay#=object position y(2)
az#=object position z(2)
if az#>-50 then az#=az#-2
position object 2,ax#,ay#,az#
if az#=<0 then ghost object on 2 else ghost object off 2
if az#=<-50 then gosub creater
sync
loop
return
The problem being the loop to move the ship becomes locked and doesnt work, ive tried subroutines (which you can see here), shifting the code around, putting it all in the same loop..i can only get one section to work at once!