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 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
`main loop
do
`update the screen
sync
`make a temporary player object
make object sphere 1,5
position object 1,250,1,250
`---------
`MAIN LOOP
`---------
main:
do
yAng=object angle y(1)
`the following is temporary. There will be more but it will made later
`get keyboard input for movement
if upkey()=1 then move object 1,4
if downkey()=1 then move object 1,-4
if leftkey()=1 then yrotate object 1,wrapvalue(yAng-4)
if rightkey()=1 then yrotate object 1,wrapvalue(yAng+4)
`work out the height of the character
xPos#=object position x(1)
zPos#=object position z(1)
yPos#=get ground height(1,xPos#,zPos#)
`update the objects position
position object 1,xPos#,yPos#,zPos#
`update the camera
chase_cam(1)
`update the screen
sync
loop