im following the tutorials and have run int oa glitch, after modify the code to work for my set up i'm getting movement errors
rem --------
rem INCLUDES
rem --------
rem include the MatEdit LoadMatrix files
#include "LoadMatrix.dba"
rem ------
rem ARRAYS
rem ------
rem declare the MatEdit variables
Dim BigMatrix(600,600,1)
Dim StartLoc_X(1): Dim StartLoc_Z(1)
im Info(2)
Dim TArrayX(1): Dim TArrayZ(1): Dim FKey(10,1)
Dim ColData(100): Dim ZoneData(100): Dim Tiles(500,500)
Dim OverTexture$(100): Dim OverName$(20): Dim ReplaceTex(100)
Dim MOffsetX(25): Dim MOffsetY(25)
Dim MWire(20): Dim MGhost(20): Dim Lock(20)
Dim MatX#(20): Dim MatY#(20): Dim MatZ#(20)
Dim MatWidth#(20): Dim MatHeight#(20)
Dim TilesX(20): Dim TilesZ(20)
Dim MatHi#(20): Dim MatLo#(20)
rem set up the program
sync on
sync rate 40
hide mouse
rem load the matrix
LoadMatrix("BASIC1",1)
`set light properties
set ambient light 50
color ambient light RGB(255,255,255)
rem set cameral draw range
set camera range 1,53000
pitch camera down 60
autocam off
rem temp turbuckles
make object cube 1, 2100
position object 1, 50000, 6300, 53000
SET OBJECT COLLISION TO BOXES 1
`--------------
`player loading
`--------------
`make a temporary player object
make object cube 2, 5
position object 2, 2500, 7000, 2500
SET OBJECT COLLISION TO BOXES 2
friction#(1)=0.97
moveDist#(1)=0.065
xSpeed#(1)=0
zSpeed#(1)=0
rem player array
dim xSpeed#(4)
dim zSpeed#(4)
dim friction#(4)
dim moveDist#(4)
`---------
`MAIN LOOP
`---------
main:
do
`get keyboard input for movement
if upkey()=1 then forward=1 else forward=0
if downkey()=1 then backward=1 else backward=0
if leftkey()=1 then left=1 else left=0
if rightkey()=1 then right=1 else right=0
`update the player
move_player(2,forward,backward,left,right)
`update the camera
chase_cam(2)
text 10,10,str$(screen fps())
`update the screen
sync
loop
`---------
`chase cam
`---------
function chase_cam(id)
`work out the angle of the object being chased
yAng#=wrapvalue(object angle y(id)+180)
`grab the objects current position
xPos#=object position x(id)
yPos#=object position y(id)
zPos#=object position z(id)
`other variables
camDist=15
camHeight=3
`work out new position
xCamPos#=newxvalue(xPos#,yAng#,camDist)
zCamPos#=newzvalue(zPos#,yAng#,camDist)
`work out camera height
yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight
if yCamPos#