This generates a 3D array and draws it in 3D.
Move with the mouse/arrow keys.
Distroy cubes with space.
This has collision also.
It's fun to run twards the group of cubes while holdig down space and make a hole through it.
print "You will be asked a few questions." : print "Normal answers are 5 for the first 3 and n for the next one." : print "And 1 for the one after." : print "Mouse to look, un/down to move, space to delete." : print "Press a key." : wait key : randomize timer()
xfail:
input "Size X ",sx : if sx=<0 then print "Too small" : goto xfail
yfail:
input "Size Y ",sy : if sy=<0 then print "Too small" : goto yfail
zfail:
input "Size Z ",sz : if sx=<0 then print "Too small" : goto zfail : if sx*sy*sz>1000 then print "Too big" : goto xfail
input "Make the array full(y/n)? ",yn$ : if yn$="y" then full=1
speed:
input "Movement speed: ",speed# : if speed#<=0 then print "Too small." : goto speed
sync on : dim d3arra(sx,sy,sz) : for x=1 to sx : for y=1 to sy : for z=1 to sz : yn=rnd(1) : if full=1 then yn=1
if yn=1 then d3arra(x,y,z)=1 : objcnt=objcnt+1 : make object cube objcnt,30 : position object objcnt,x*30,y*30,z*30 : set object collision to boxes objcnt : color object objcnt,rgb(rnd(255),rnd(255),rnd(255)) : set object light objcnt,1
next sz : next sy : next sx : make object cube 10000,3 : do : col=object collision(10000,0) : C3(speed#) : position object 10000,camera position x(),camera position y(),camera position z()
if col>0 then : position camera ox#,oy#,oz# : if spacekey()=1 then delete object col
ox#=camera position x() : oy#=camera position y() : oz#=camera position z()
sync : loop
function C3(Speed as float)
xrotate camera camera angle x()+mousemovey() : yrotate camera camera angle y()+mousemovex() : if upkey()=1 then move camera Speed
if downkey()=1 then move camera (0-Speed) : r=mousemovex() : r=mousemovey()
endfunction
-Ilya