kenmo, i added a little line of code that makes it so that the balls cant be dark, i'm posting the code in layed out form caus it's easer to read
rem TUNNEL GAME by kenmo, redone in less than 20 lines!
set display mode 800,600,16
hide mouse
sync on
sync rate 40
randomize timer()
im=0
repeat
inc im
until file exist(str$(im)+".jpg")=0
dec im
set global collision off
autocam off
set camera fov 2
sp#=500
acc#=50
imp#=-100
t#=360
fog on
fog color 0
fog distance 500
backdrop on
color backdrop 0
do
inc lev
rem This code makes it so that it doesn't pic certen bitmaps
rem (Dark colored ones) it's also easy to modify if you add
rem more bitmaps
repeat
image = rnd(im-1)+1
until image <> 1 and image <> 3 and image <> 5
rem end of extra code
load image str$(rnd(im-1)+1)+".jpg",1
load image str$(image)+".jpg",2
make matrix 1,100,1000,10,10
prepare matrix texture 1,1,1,1
fill matrix 1,0,1
for tmp=1 to 9
for tmpx=0 to 10
set matrix height 1,tmp,tmpx,0-SQRT(50^2-((tmp-5)*10)^2)
next tmpx
next tmp
update matrix 1
make matrix 2,100,1000,10,10
prepare matrix texture 2,1,1,1
fill matrix 2,0,1
for tmp=1 to 9
for tmpx=0 to 10
set matrix height 2,tmp,tmpx,SQRT(50^2-((tmp-5)*10)^2)
next tmpx
next tmp : update matrix 2
dim rock#(lev,2)
for tmp=1 to lev
make object sphere tmp,10
texture object tmp,2
rock#(tmp,1)=rnd(359)
rock#(tmp,2)=600+tmp*(600/lev)
next tmp
mg=lev*21
hit=0
pas=0
s#=0
a#=0
z#=0
st=timer()
t=timer()
do
ot=t
t=timer()
fps#=((t-ot)/1000.0)
inc z#,s#*fps#
inc s#,acc#*fps#
if s#>sp#
s#=sp#
endif
while z#>400
dec z#,400
for tmp=1 to lev
rock#(tmp,2)=rock#(tmp,2)-400
next tmp
endwhile
while z#<0
inc z#,400
for tmp=1 to lev
rock#(tmp,2)=rock#(tmp,2)+400
next tmp
endwhile
if leftkey()=1
a#=wrapvalue(a#-t#*fps#)
endif
if rightkey()=1
a#=wrapvalue(a#+t#*fps#)
endif
da#=curveangle(a#,da#,8)
position camera 50+sin(da#)*25,0-(cos(da#)*25),z#
rotate camera 0,0,da#
for tmp=1 to lev
position object tmp,50+sin(rock#(tmp,1))*25,0-(cos(rock#(tmp,1))*25),rock#(tmp,2)
if dist(camera position x(),camera position y(),camera position z(),50+sin(rock#(tmp,1))*25,0-(cos(rock#(tmp,1))*25),rock#(tmp,2))<=100 and rock#(tmp,2)>z#
cls 255
s#=imp#
hit=1
dec score,5
endif
rock#(tmp,2)=rock#(tmp,2)-50*fps#
turn object left tmp,360*fps#
while rock#(tmp,2)<z#-10
rock#(tmp,2)=rock#(tmp,2)+600
rock#(tmp,1)=rnd(359)
inc pas
inc score
endwhile
next tmp
tmp#=255.0-(pas*255.0/mg)
ink rgb(255,tmp#,tmp#),0
timer=((t-st)/1000)
center text 400,150,"LEVEL "+str$(lev)
center text 400,166,"You need "+str$(mg-pas)+" more in "+str$(60-timer)+" seconds!"
ink rgb(32,32,32),0
center text 400,450,"[ tunnel by kenmo ]"
if pas>=mg
cls 0
for tmp=1 to 2
delete matrix tmp
delete image tmp
next tmp
for tmp=1 to lev
delete object tmp
next tmp:if hit=0
inc score,50
endif
inc score,100
exit
endif
if timer>=60
goto lose
endif
sync
loop
loop
lose:
backdrop off
cls 0
for tmp=1 to 2
delete matrix tmp
delete image tmp
next tmp
for tmp=1 to lev
delete object tmp
next tmp
ink rgb(255,255,0),0
center text 400,284,"YOU LOST ON LEVEL "+str$(lev)+"!"
center text 400,300,"Your score is "+str$(score)+"."
ink rgb(32,32,32),0
center text 400,580,"[ press any key to exit ]"
sync
wait key
end
function dist(x#,y#,z#,xx#,yy#,zz#)
d#=((xx#-x#)^2+(yy#-y#)^2+(zz#-z#)^2)
endfunction d#
Sparring - Loved by many, Pefected by few.