try this:
rem ============================================
rem DARK BASIC EXAMPLE PROGRAM 12
rem ============================================
rem This program creates a mouselook effect
rem --------------------------------------------
rem Manual sync
sync on
rem Make simple 3D scene
set camera range 1,5500
make matrix 1,6000,6000,25,25
position matrix 1,-3000,0,-3000
make object sphere 1,5000
set object 1,1,0,0
position camera 0,100,0
rem Begin loop
do
rem Crude way to fix mouse pointer (hide this and run again)
position mouse 320,240
rem Use MOUSEMOVE to alter camera angles
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())
rotate camera cx#,cy#,cz#
rem placement of the camera on the ground
camposx#=camera position x()
camposz#=camera position z()
camposy#=get ground height(1,camposx#,camposz#)+50
rem Simple movement
if leftkey()=1 then camposx#=newxvalue(camposx#,cy#-90,25):camposz#=newzvalue(camposz#,cy#-90,25)
if rightkey()=1 then camposx#=newxvalue(camposx#,cy#+90,25):camposz#=newzvalue(camposz#,cy#+90,25)
if upkey()=1 then camposx#=newxvalue(camposx#,cy#,25):camposz#=newzvalue(camposz#,cy#,25)
if downkey()=1 then camposx#=newxvalue(camposx#,cy#,-25):camposz#=newzvalue(camposz#,cy#,-25)
position camera camposx#,camposy#,camposz#
rem Update screen
sync
rem End loop
loop
cheers
if I = 1 then I = 1 else I = 0