I kind of did what Daemon did, just a little different. I've turned the maze into a free-flight 3D maze
A couple things to note:
A. This is my first time posting code, so if it doesn't show up, it's completely my fault
B. Don't back up into the walls. It's difficult to get out.
C. Daemon gets most of the credit for this, he came up with the original code for the maze. I just made it 3D-ish.
D.I would've compressed this more, but I just don't find compressing code fun when it's 12:00 A.M.
sync on : sync rate 0 : hide mouse : randomize timer(): while xtiles/2=xtiles/2.0 : print "Value must be odd" : sync : input "X tiles ",xtiles : endwhile : while ytiles/2=ytiles/2.0 : print "Value must be odd" : sync : input "Y tiles ",ytiles : endwhile : while ztiles/2=ztiles/2.0 : print "Value must be odd" : sync : input "Z tiles (Maze Height)",Ztiles : endwhile : cls
xtiles=abs(xtiles) : ytiles=abs(ytiles) : ztiles=abs(ztiles) : obj=1 : global counter : counter=2*xtiles+2*ytiles-2 : global dim maze(xtiles,ytiles,ztiles) as boolean : for z=1 to ztiles : for x=1 to xtiles : maze(x,1,z)=1 : maze(x,ytiles,z)=1 : next x : for y=1 to ytiles : maze(1,y,z)=1 : maze(xtiles,y,z)=1 : next y : next z : max=(xtiles*ytiles)-((xtiles-2)*(ytiles-2)-((xtiles-3)/2)*(ytiles-3))+2 : for z=1 to ztiles step 2 : while counter<max and spacekey()=0 : CreateMaze(xtiles,ytiles,z) : endwhile : counter=2*xtiles+2*ytiles-2 : next z
make light 1 : set light range 1,30 : for z=1 to ztiles : for x=1 to xtiles : for y=1 to ytiles : if z/2.0=z/2 : if x/2.0=x/2 and y/2.0=y/2 or maze(x,y,z-1)=1 or maze(x,y,z+1)=1 or maze(x,y,z-2)=0 then maze(x,y,z)=1:inc counter2 : if counter2=xtiles*ytiles then delete object obj-(1+ytiles) : endif : if maze(x,y,z)=1 : make object cube obj,10 : position object obj,10*x,10*z,10*y : inc obj : endif : next y : next x : counter2=0 : next z
inc obj : make object box obj,10*xtiles,10,10*ytiles : position object obj,xtiles*5+5,0,ytiles*5+5 : inc obj : make object box obj,10*xtiles,10,10*ytiles : position object obj,xtiles*5+5,ztiles*10+10,ytiles*5+5 : make object sphere obj+1,9 : position object obj+1,xtiles*10-10,ztiles*10,ytiles*10-10 : color object obj+1,rgb(0,0,0) : time=timer() : position camera 20,10,20 : ink rgb(255,0,255),0 : while 5<sqrt((camera position x()-object position x(obj+1))^2+(camera position y()-object position y(obj+1))^2+(camera position z()-object position z(obj+1))^2)
sync : move#=(upkey()-downkey())*.3 : a=pick object (screen width()/2,screen height()/2,1,obj) : px#=get pick vector x() : py#=get pick vector y() : pz#=get pick vector z() : dist#=sqrt(px#^2+py#^2+pz#^2) : if dist#<1.5 then move#=0 : move camera move# : rotate camera camera angle x()+(mousemovey()/2.0),camera angle y()+(mousemovex()/2.0),0 : position light 1,camera position x(),camera position y(),camera position z() : color light 1,RGB((sin(col#)*50)+205,(sin(col#-20)*50)+100,(sin(col#-240)*25)+25) : inc col#,.1
if col#>360 then col#=0 : if object in screen(obj+1) then circle object screen x(obj+1),object screen y(obj+1),5 : endwhile : cls : time=timer()-time : print "YOU WIN MR. USER. IT TOOK YOU "+str$((time/1000))+" SECONDS" : print "A Daemon and I'm Still here production" : print "With Special thanks to Diggsey" : print "(Click to Exit)" : sync : wait mouse : end
function CreateMaze(xtiles,ytiles,z) : x=rnd(xtiles-2)+1 : y=rnd(ytiles-2)+1 : if maze(x,y,z)=1 : exitfunction : endif : if x/2.0=x/2 and y/2.0=y/2 : exitfunction : endif : walls=0 : walls=walls+maze(x-1,y,z) : walls=walls+maze(x+1,y,z) : walls=walls+maze(x,y-1,z) : walls=walls+maze(x,y+1,z)
if walls<>1 : exitfunction : endif : if maze(x-1,y-1,z)=1 and maze(x-1,y,z)+maze(x,y-1,z)=0 : exitfunction : endif : if maze(x-1,y+1,z)=1 and maze(x-1,y,z)+maze(x,y+1,z)=0 : exitfunction
endif
if maze(x+1,y-1,z)=1 and maze(x+1,y,z)+maze(x,y-1,z)=0
exitfunction
endif
if maze(x+1,y+1,z)=1 and maze(x+1,y,z)+maze(x,y+1,z)=0
exitfunction
endif
maze(x,y,z)=1
inc counter
endfunction