I spent all night working on htis code and I still can't seem to get the camera to "Walk" on top of the 2nd matrix... can anybody help???
Rem Project: simplematrixwalk
Rem Created: 16/02/2003 11:04:22 PM
Rem ***** Main Source File *****
Rem contains otherstuff not needed...
Rem this is the crap i'm not sure i need...
sync on : randomize timer() : autocam off : hide mouse
rem *** variables ***
cameraxpostepsize#=0 : rem Camera start x position
cameraypostepsize#=0 : rem Camera start z position
camerayangle#=0 : rem Camera start y angle
cameraxangle#=0 : rem Camera start x angle
playerheight=30 : rem Height of Player(From Eyes)
stepsize#=1 : rem Player step size
matrixmaxheight#=50 : rem The max height for randomize matrix
maxangleup#=50 : rem maximum angle you can look up
maxangledown#=80 : rem maximum angle you can look down
mousespeed#=3 : rem Speed of mouse(higher=slower)
MatrixNumber=1
make matrix MatrixNumber,1000,1000,25,25
randomize matrix MatrixNumber, matrixmaxheight#
update matrix MatrixNumber
make matrix 2,1000,1000,25,25
position matrix 2,1000,0,0
randomize matrix 2, matrixmaxheight#
update matrix 2
ImageNumber=1
load image "ground.jpg",ImageNumber
prepare matrix texture 2,ImageNumber,1,1
h#=get ground height(1,cameraxpostepsize#,cameraypostepsize#)
position camera cameraxpostepsize#,h#+playerheight,cameraypostepsize#
do
x# = camera position x()
y# = camera position y()
z# = camera position z()
if upkey()
x#=newxvalue(x#,camerayangle#,stepsize#)
z#=newzvalue(z#,camerayangle#,stepsize#)
endif
if downkey()
x#=newxvalue(x#,camerayangle#,-stepsize#)
z#=newzvalue(z#,camerayangle#,-stepsize#)
endif
if rightkey()
x#=newxvalue(x#,wrapvalue(camerayangle#+90.0),stepsize#)
z#=newzvalue(z#,wrapvalue(camerayangle#+90.0),stepsize#)
endif
if leftkey()
x#=newxvalue(x#,wrapvalue(camerayangle#-90.0),stepsize#)
z#=newzvalue(z#,wrapvalue(camerayangle#-90.0),stepsize#)
endif
if camera position x() > 1000
h#=get ground height(1,x#,z#)
position camera x#,h#+playerheight,z#
camerayangle#=wrapvalue(camerayangle#+(mousemovex()/mousespeed#))
cameraxangle#=cameraxangle#+(mousemovey()/mousespeed#)
if cameraxangle# maxangledown# then cameraxangle#=maxangledown#
rotate camera wrapvalue(cameraxangle#),camerayangle#,0
else
sech#=get ground height(2,x#,z#)
position camera x#,sech#+playerheight,z#
camerayangle#=wrapvalue(camerayangle#+(mousemovex()/mousespeed#))
cameraxangle#=cameraxangle#+(mousemovey()/mousespeed#)
if cameraxangle# maxangledown# then cameraxangle#=maxangledown#
rotate camera wrapvalue(cameraxangle#),camerayangle#,0
endif
rem Show Framerate
text 20,screen height()-40,desc$
fps$="DBPro Fps: "+str$(screen fps())
text screen width()-20-text width(fps$),screen height()-40,fps$
sync
loop
wait key