Here is a basic framework for a fps game:
sync on : sync rate 0 : autocam off : hide mouse
` make a random matrix
make matrix 1,1000,1000,32,32
randomize matrix 1,20
update matrix 1
` position camera in centre of matrix
position camera 500,0,500
s#=1.0 : ` how far to move each keypress
max_up#=50 : ` maximum angle you can look up
max_down#=80 : ` maximum angle you can look down
do
x#=camera position x() : y#=camera position y() : z#=camera position z()
xa#=camera angle x() : ya#=camera angle y() : za#=camera angle z()
` handle moving forward, moving back, straffing left, straffing right
if upkey() then x#=newxvalue(x#,ya#,s#) : z#=newzvalue(z#,ya#,s#)
if downkey() then x#=newxvalue(x#,ya#,-s#) : z#=newzvalue(z#,ya#,-s#)
if leftkey() then x#=newxvalue(x#,wrapvalue(ya#-90.0),s#) : z#=newzvalue(z#,wrapvalue(ya#-90.0),s#)
if rightkey() then x#=newxvalue(x#,wrapvalue(ya#+90.0),s#) : z#=newzvalue(z#,wrapvalue(ya#+90.0),s#)
` position camera 20 units above matrix height below player
h#=get ground height(1,x#,z#)
position camera x#,h#+20,z#
` free-look around with mouse
xa#=wrapvalue(xa#+(mousemovey()/3))
ya#=wrapvalue(ya#+(mousemovex()/3))
if xa# > 180 and xa# < (360.0-max_up#) then xa#=(360.0-max_up#)
if xa# > max_down# and xa# < 180 then xa#=max_down#
rotate camera xa#,ya#,0
sync
loop
Boo!