I think its better to post my whole code...
make matrix 1,3000,3000,30,30
load image "C:\Programme\Dark Basic Professional Demo\Projects\eigene\Torn.bmp",1
prepare matrix texture 1,1,2,2
randomize matrix 1,40
x# = 1000
z# = 1500
stepV# = 0.8
set matrix height 1,5,5,700
set matrix height 1,4,5,500
set matrix height 1,5,6,300
update matrix 1
hide mouse
do
mx# = mousemovex()
my# = mousemovey()
print y#
print get matrix height(1,x#/100,z#/100) +30
print stepV#
rem Crude way to fix mouse pointer (hide this and run again)
position mouse 320,240
if y# < get matrix height(1,x#/100,z#/100) +30 then y# = get matrix height(1,x#/100,z#/100) +30:stepV#=0.6
if y# > get matrix height(1,x#/100,z#/100) +30
y# = y# - fall#
fall#=fall# + 0.02
else
if fall#> 0 then stepv# = stepV# - fall#*0.3
fall# = 0
endif
if mx#<>0 then a#=wrapvalue(a#+mx#/2)
if my#<>0 then cy#=cy# - my#*2
if stepV# < 0.8 then stepV# = stepV# + 0.003
if stepv# < 0 then stepV# = 0
if leftkey()=1 then x#=newxvalue(x#,a# -90,1) : z#=newzvalue(z#,a# -90,1)
if rightkey()=1 then x#=newxvalue(x#,a# +90,1) : z#=newzvalue(z#,a# +90,1)
rem Control camera with arrow keys
if upkey()=1 then x#=newxvalue(x#,a#,stepV#) : z#=newzvalue(z#,a#,stepV#)
if downkey()=1 then x#=newxvalue(x#,a#,-stepV#) : z#=newzvalue(z#,a#,-stepV#)
rem Position camera to the back of the character
ca#=wrapvalue(curveangle(a#,ca#,12.0))
cx#=newxvalue(x#,wrapvalue(ca#+180),+300)
cz#=newzvalue(z#,wrapvalue(ca#+180),+300)
if cy#<-400 then cy#=-400
if cy#>800 then cy# = 800
position camera x#,y# +30,z#
point camera cx#,y#+cy#+30,cz#
yrotate camera wrapvalue(ca#)
loop