global t=2
sync on : sync rate 0 : autocam off
makebox(1,500,50,50)
position object 1,0,0,250
color object 1,rgb(255,0,0)
makebox(2,500,50,50)
position object 2,0,0,-250
color object 2,rgb(255,0,0)
makebox(3,50,50,500)
position object 3,250,0,0
color object 3,rgb(255,0,0)
makebox(4,50,50,500)
position object 4,-250,0,0
color object 4,rgb(255,0,0)
makebox(5,50,50,50)
position object 5,100,0,0
color object 5,rgb(0,255,0)
makebox(10,50,50,50)
color object 10,rgb(0,0,255)
position object 10,0,0,0
position camera 0,100,-400
point camera 0,0,0
do
forward =0
reverse=0
x#=object position x(10) : y#=object position y(10) : z#=object position z(10)
if upkey()=1 then move object 10,1:forward=1
if downkey()=1 then move object 10,-1: reverse=1
if leftkey()=1 and forward > 0 then yrotate object 10, wrapvalue(object angle y(10)-1)
if leftkey()=1 and reverse > 0 then yrotate object 10, wrapvalue(object angle y(10)+1)
if rightkey()=1 and forward > 0 then yrotate object 10, wrapvalue(object angle y(10)+1)
if rightkey()=1 and reverse > 0 then yrotate object 10, wrapvalue(object angle y(10)-1)
if object collision(10,0)
dec x#,get object collision x()
dec y#,get object collision y()
dec z#,get object collision z()
position object 10,x#,y#,z#
endif
sync
loop
function makebox(o,x,y,z)
make object box o,x,y,z
make object collision box o,(x/2*-1)-t,(y/2*-1)-t,(z /2*-1)-t,(x/2)+t,(y/2)+t,(z/2)+t,0
endfunction
Rem Project: test
Rem Created: 11/22/2003 3:45:12 PM
Rem ***** Main Source File *****