Thats quite the load of code...
Ok well here we go..
Quoting Directly from Binary Moon tutorial if you would just read it.
make matrix id, width, depth, xTiles, zTiles
width=100
depth=50
xTiles=20
zTiles=15
make matrix 1,width,depth,xTiles,zTiles
randomize matrix id, maxHeight#
set matrix height id, x, z, height
for xTile=0 to XTiles
for zTile=0 to ZTiles
height=rnd(20)
set matrix height id,xTile,zTile,height
next zTile
next xTile
update matrix id
Width=100
depth=50
xTiles=20
zTiles=15
make matrix 1,width,depth,xTiles,zTiles
randomize matrix 1,10
update matrix 1
Texturing a matrix
prepare matrix texture id, image, across, down
set matrix tile id, xTile, zTile, textureTile
sync on
hide mouse
`---------------
`create a matrix
`---------------
`the matrix will be 100 units square and be split up into 100 squares (10*10)
make matrix 1,100,100,10,10
`set the matrix heights
`I am going to use two for loops to do this
`the first loops through the xPoints, the second through the zPoints
for xPoint=0 to 10
for zPoint=0 to 10
`create a sinewave matrix
`I just made the following bit up and it looked nice
`you can just as easily use your own numbers/ math's to create terrain's
`you could also use a loop like this to read values you have saved from
`a text file created by an editor
height=(sin(xPoint*36)+cos(zPoint*36))*5
set matrix height 1,xPoint, zPoint, height
next zPoint
next xPoint
`----------------------
`set the matrix texture
`----------------------
`load matrix texture
load image "floor1.bmp",1
`prepare the matrix texture
prepare matrix texture 1, 1, 2,2
`loop through matrix tiles
for xTile=0 to 9
for zTile=0 to 9
`set the matrix tile texture
`the texture is a random value
set matrix tile 1,xTile,zTile,rnd(3)+1
next zTile
next xTile
`update the matrix after it has been changed
update matrix 1
`position the camera so that it has a good view
Position camera 50,50,-50
point camera 50,25,50
`main loop
do
`update the screen
sync
loop
)Making an object move: (Taken directly from the Darkbasic Program
rem ===========================================
rem DARK BASIC EXAMPLE PROGRAM 3
rem ===========================================
rem This program operates a third person camera
rem -------------------------------------------
rem Make a simple scene for the camera to look at
make matrix 1,10000.0,10000.0,25,25
load bitmap "floor1.bmp",1
get image 1,0,0,256,256
delete bitmap 1
prepare matrix texture 1,1,2,2
randomize matrix 1,50.0
set matrix height 1,12,12,300.0
update matrix 1
rem Create blob character to follow
make object sphere 1,100.0
rem Set variables for character position
x#=500
z#=500
rem Activate manual sync
sync on
rem Begin loop
do
rem Control camera with arrow keys
if upkey()=1 then x#=newxvalue(x#,a#,10) : z#=newzvalue(z#,a#,10)
if downkey()=1 then x#=newxvalue(x#,a#,-10) : z#=newzvalue(z#,a#,-10)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)
rem Update character
y#=get ground height(1,x#,z#)+50.0
position object 1,x#,y#,z#
yrotate object 1,a#
rem Position camera to the back of the character
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+100.0
position camera cx#,cy#,cz#
rem Point camera at object
point camera x#,y#,z#
rem Syncronise
sync
rem End loop
loop
Read through tutorials, and search the forum for previous threads already asking your questions.