Well first of all I'd write this bit like this
If Object Position Y (10)<-10000
for x = 11 to 300
rem - ERROR ORIGINATES HERE -
delete object x
rem - ERROR ORIGINATES HERE -
next x
endif
and then you'd need to position your sphere back to the top and create more objects to replace the ones you just deleted. Maybe something like the following?
rem make the sphere
make object sphere 10,50
autocam off
rem make the boundries and position them and rotate them
MAKE OBJECT PLAIN 1, 1000, 100000
MAKE OBJECT PLAIN 2, 1000, 100000
position object 1, -800,400,0
position object 2, 400,400,0
rotate object 1, 0, 90 ,0
rotate object 2, 0, 90 ,0
rem position sphere and give collision box
position object 10, 0,400,0
make object collision box 10,-10,-10,-10,10,10,10,0
sync on:sync rate 30
gosub make_cubes
do
rem set some varibales
X# = Object position x(10)
Z# = Object position z(10)
Y# = Object position y(10)
rem set up control scheme and falling gravity
If Leftkey()=1 then Position object 10,(X#-10),(Y#-10),Z#
If Rightkey()=1 then Position object 10,(X#+10),(Y#-10),Z#
If Leftkey()=0 and Rightkey()=0 then Position object 10,X#,(Y#-10),Z#
rem some collision stuff
If Object Collision (10,1)=1 then Position object 10,X#,(Y#-10),Z#
If Object Collision (10,2)=1 then Position object 10,X#,(Y#-10),Z#
``If Object Collision (10,0)>0 then wait 2000:end
rem destroy all previously created cubes if player has passed them all
If Object Position Y (10)<-10000
for x = 11 to 300
delete object x
next x
gosub make_cubes
position object 10,object position x(10),400,object position z(10)
endif
rem position the camera
Position Camera X#,(Y#),-500
sync
loop
rem make the cubes for the sphere to dodge
make_cubes:
for x = 11 to 300
make object cube x,50
color object x, rgb(rnd(255)+1,rnd(255)+1,rnd(255)+1)
Position Object x, rnd(500)-rnd(1000),rnd(10000)*-1,0
make object collision box x,-25,-25,-25,25,25,25,0
next x
return