i have found this snippet from my DB Classic archive, it could push you in the right direction
rem set screen size/sync rate etc...
rem set display mode 800,600,16
sync on
sync rate 70
hide mouse
autocam off
set camera range 1,10000
rem load media
gosub _load_level1_images
rem make scenery
backdrop on
color backdrop rgb(150,150,210)
make matrix 1,10000,10000,25,25
prepare matrix texture 1,1,1,1
fill matrix 1,0.0,1
randomize matrix 1,200
rem fog/light generation
fog on
fog color rgb(150,150,210)
fog distance 6000
set ambient light 50
rem Create character to follow
make object cone 1,100.0
xrotate object 1,90
fix object pivot 1
scale object 1,100,10,150
ghost object on 1
position object 1,5000,get ground height(1,5000,5000)+50.0,5000
rem Set variables for character start angles
yangle#=object angle y(1)
rem movement constants
inertia#=0.85
runspeed#=1.5
turnspeed#=4
strafespeed#=1.5
jumpHeightY#=4
gravity#=0.85
rem camera constants
camdistance=300
tiltspeed#=0.05
smoothspeed#=6.0
rem MAIN =============================================================
do
rem move player forward and back with arrow keys
if upkey()=1 then forwardSpeed#=forwardSpeed#+runspeed#
if downkey()=1 then forwardSpeed#=forwardSpeed#-runspeed#
forwardSpeed#=forwardSpeed#*inertia#
move object 1,forwardSpeed#
rem control strafe with left/right keys
if rightkey()=1 then strafe#=strafe#+strafespeed#
if leftkey()=1 then strafe#=strafe#-strafespeed#
strafe#=strafe#*inertia#
charYAngle#=object angle y(1)+90
charPosX#=object position x(1)+(sin(charYAngle#)*strafe#)
charPosZ#=object position z(1)+(cos(charYAngle#)*strafe#)
rem control left/right turning movement with mouse
yangle#=wrapvalue(curvevalue(yangle#+(mousemovex()*turnspeed#),yangle#,10))
yrotate object 1,yangle#
rem position character height
heightUnderChar#=get ground height(1,object position x(1),object position z(1))
charPosY#=heightUnderChar#+50.0
rem enter key jumps
if returnkey()=1
endif
rem update player position
position object 1,charPosX#,charPosY#,charPosZ#
rem control camera height with up/down mouse movement
heightUnderCam#=get ground height(1,camera position x(),camera position z())
camceil#=heightUnderCam#+300.0
camfloor#=heightUnderCam#+70.0
camypos#=curvevalue(camypos#-(mousemovey()/tiltspeed#),camypos#,10)
if camypos# >= camceil# then camypos#=camceil#
if camypos# <= camfloor# then camypos#=camfloor#
rem position autocam smoothly
xcam#=newxvalue(object position x(1),wrapvalue(yangle#+180),camdistance)
zcam#=newzvalue(object position z(1),wrapvalue(yangle#+180),camdistance)
smoothxcam#=curvevalue(xcam#,camera position x(),smoothspeed#)
smoothzcam#=curvevalue(zcam#,camera position z(),smoothspeed#)
smoothycam#=curvevalue(camypos#,camera position y(),smoothspeed#)
position camera smoothxcam#,smoothycam#,smoothzcam#
point camera object position x(1),object position y(1)+20,object position z(1)
sync
loop
rem END ==============================================================
rem Function List -----------------------------------
rem loads a bitmap then creates an image
function loadImage(imageName$,imageNumber)
load bitmap imageName$,1
get image imageNumber,0,0,bitmap width(1),bitmap height(1)
delete bitmap 1
endfunction
rem Subroutine list ---------------------------------
rem Level 1
_load_level1_images:
load image "grass.bmp",1
load image "tree.bmp",2
return
What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home