hi,this is a neat little dodging game i rigged up in my spare time.
still working on it but here it is.
gosub setup
do
if rightkey()
moveobjright()
endif
if leftkey()
moveobjleft()
endif
moveallboxes()
position camera object position x(301), object position y(301)+1, object position z(301)
move camera -30
OBJCOLLISION()
main:
wait 70
loop
setup:
randomize timer()
color backdrop rgb (0,0,0)
set ambient light 60
make object box 301,2,2,2
color object 301,rgb(100,100,0)
GLOBAL DIM objectvis(15)
for begin=1 to 300
make object box begin,2,2,2
posrow=rnd(7)
if posrow=0
position object begin,4,2,rnd(100)+20
endif
if posrow=1
position object begin,9,2,rnd(1000)+20
endif
if posrow=2
position object begin,14,2,rnd(1000)+20
endif
if posrow=3
position object begin,19,2,rnd(1000)+20
endif
if posrow=4
position object begin,13,2,rnd(1000)+20
endif
if posrow=5
position object begin,18,2,rnd(1000)+20
endif
if posrow=6
position object begin,23,2,rnd(1000)+20
endif
if posrow=7
position object begin,28,2,rnd(1000)+20
endif
next begin
return
function moveallboxes()
timeintogame=timeintogame-2
for begin=1 to 300
if object exist(begin)
move object begin,timeintogame
endif
next begin
endfunction
function moveobjright()
if object position x(301)=28
cantmoveobj=1
endif
if cantmoveobj=1
goto main
endif
position object 301,object position x(301)+4,2,0
endfunction
function moveobjleft()
if object position x(301)=8
cantmoveobj=1
endif
if cantmoveobj=1
goto main
endif
position object 301,object position x(301)-4,2,0
endfunction
function OBJCOLLISION()
for begin=1 to 300
if object collision(301,begin)
END
endif
next begin
endfunction
if you find any bugs plz tell me.