Not sure this will help:
_______TOP_______:
rem Generic Template
rem 1stP Cam Template
_____INITIALIZE_____:
set display mode 1024,768,32
SYNC ON
SYNC RATE 60
backdrop on
rem hide mouse
color backdrop rgb(10,100,100)
autocam off
set global collision off
s#=0.0:cx#=2000.0:cy#=0.0:cz#=1000.0:cax#=0:cay#=0
gosub Setupland1
gosub makecubes
gosub ambient
gosub resetcam
_____DO_LOOP_____:
do
if cx#<100 then cx#=100
if cz#<100 then cz#=100
if cx#>landsize-100 then cx#=landsize-100
if cz#>landsize-100 then cz#=landsize-100
if inkey$()="m" then gosub hidemouse
gosub printdata
gosub update_camera
SYNC
loop
____SET_SCENERY___:
Setupland1:
rem ground textures
rem create texture
cls rgb(0,100,20)
inkcolor#=rgb(255,255,255)
line 0,0,0,250
line 1,1,1,250
line 0,0,250,0
line 1,1,250,1
get image 2,0,0,250,250
rem Make landscape
landsize=4000:grid=30:mtxrandomize=1
make matrix 1,landsize,landsize,grid,grid
set matrix 1,1,0,0,1,1,1,1
prepare matrix texture 1,2,1,1
randomize matrix 1,mtxrandomize
update matrix 1
return
______CAMERA_ROUTINES____:
update_camera:
if inkey$()="q" then s#=0.0
if mouseclick()=0
mymousex=mousemovex()
if mymousex>0 then cay#=wrapvalue(cay#+3)
if mymousex<0 then cay#=wrapvalue(cay#-3)
mymousey=mousemovey()
if mymousey>0 then cax#=wrapvalue(cax#+3)
if mymousey<0 then cax#=wrapvalue(cax#-3)
endif
mymousez=mousemovez()
if mymousez>0 then camhgt=camhgt+10
if mymousez<0 then camhgt=camhgt-10
cx#=newxvalue(cx#,cay#,s#)
cz#=newzvalue(cz#,cay#,s#)
cy#=get ground height(1,cx#,cz#)
if inkey$()="w" and s#<8 then s#=s#+0.1
if inkey$()="s" and s#>-8 then s#=s#-0.2
if inkey$()="a" then cay#=wrapvalue(cay#-1)
if inkey$()="d" then cay#=wrapvalue(cay#+1)
position camera cx#,cy#+camhgt,cz#
yrotate camera cay#
xrotate camera cax#
return
rem camera reset
Resetcam:
set camera range 1,20000
camhgt=100
return
hidemouse:
position mouse 900,10
if inkey$()="m" and cflag=0 then show mouse:cflag=1:wait 100:return
if inkey$()="m" and cflag=1 then hide mouse:cflag=0:wait 100:return
return
_____PRINT_ON__SCREEN___:
printdata:
set cursor 0,0
print "Polys=",statistic(1)
print "FPS=",screen fps()
print "camera x#= ",cx#
print "ground h#= ",h#
print "camera z#= ",cz#
print "camera angle cay#= ",cay#
print "camera angle cax#= ",cax#
print "speed s#= ",s#
print
print "W,A,S,D = movement"
print "Mouse = manage cam look"
print "Mousewheel= change camera height"
print "q to stop"
print "press m to hide/show mouse cursor"
return
____MAKE_OBJECTS____:
rem -------------Characters-Objects------------
makeplayer1:
make object cube 10,20
scale object 10,100,200,100
return
makecubes:
randomize 1
cubesize=100
for n=100 to 110
make object cube n,cubesize
set object n,1,1,1,1,1,1
color object n,rgb(rnd(150),rnd(150),rnd(150))
xpos=rnd(landsize):zpos=rnd(landsize)
position object n,xpos,cubesize/2,zpos
next n
return
_______AMBIENT_______:
ambient:
set ambient light 70
fog on
fog color rgb(150,150,200)
fog distance 10000
return
end