I always do things the HARD way for some reason, anyway, texture the matrix to see this better, just try it out, theres no friction so up increases acc and down decreases it.... sorry bout it being all messed up, try and simplify it? Anyway, you can see how it basically works...
REM IM A DBpro NEwBIE, SORRY BOUT RUBBISH CODING, MAYBE YOU CAN SIMPLIFY IT?
REM SETUP THE MAIN STUFF
Sync on:sync rate 50:Hide mouse
REM EXAMPLE OBJECT CUBE
REM SPHERES ARE FOR READING POINTS, SO THEY HIDDEN
Make object cube 1,1
Make object sphere 2,1
Make object sphere 3,1
Hide object 2
Hide object 3
REM JUST SOME RANDOM LANDSCAPE TO TEST
Make matrix 1,3000,3000,100,100
Randomize matrix 1,20
update matrix 1
REM MAIN LOOP
Do
REM POSITION SPHERES IN FRONT AND BEHIND CUBE AND SET TO HEIGHT OF GROUND
Position object 2,object position x(1),object position y(1),object position z(1)
Yrotate object 2,object angle y(1)
Move object 2,1
Position object 2,object position x(2),Get ground height(1,object position x(2),object position z(2)),object position z(2)
Position object 3,object position x(1),object position y(1),object position z(1)
Yrotate object 3,object angle y(1)
Move object 3,-1
Position object 3,object position x(3),Get ground height(1,object position x(3),object position z(3)),object position z(3)
REM CUBE POSITIONING AND CONTROL
If object position y(1)=<get ground height(1,object position x(1),object position z(1))+0.01
Xrotate object 1,((ATan((object position y(3)-object position y(2))/2)))
Position object 1,object position x(1),get ground height(1,object position x(1),object position z(1)),object position z(1)
If Grav#=<0 then Grav#=0
If object position y(1)=<get ground height(1,object position x(1),object position z(1)) then Grav#=Grav#+0.01
If upkey()=1 and acc#=<0.5 then acc#=acc#+0.01
If downkey()=1 and acc#=>-0.5 then acc#=acc#-0.01
Endif
If leftkey()=1 then yrotate object 1,object angle y(1)-3
If rightkey()=1 then yrotate object 1,object angle y(1)+3
REM UPDATE CUBE POSITION
Grav#=Grav#-0.005
Move object 1,acc#
Position object 1,object position x(1),object position y(1)+Grav#,object position z(1)
REM POSITION CAMERA BEHIND CUBE
Position camera 0,object position x(1),object position y(1),object position z(1)
Yrotate camera 0,object angle y(1)
Move camera 0,-4
Xrotate camera 0,270
Move camera 0,2
Xrotate camera 0,0
REM REPEAT LOOP
Sync
Loop
:p