Here's the code for fps style movement, including mouselook and strafing:
sync on
sync rate 30
hide mouse
autocam off
height=100
make matrix 1,1000,1000,5,5
do
a#=wrapvalue(a#+1)
dx#=dx#+mousemovey()*0.25
cy#=wrapvalue(cy#+mousemovex()*0.25)
if dx#>90 then dx#=90
if dx#<-90 then dx#=-90
cx#=wrapvalue(dx#)
set cursor 1,1
print screen fps()
rotate camera cx#,cy#,cz#
oldx#=x#
oldz#=z#
if upkey()=1 then x#=x#+sin(cy#)*15
if upkey()=1 then z#=z#+cos(cy#)*15
if downkey()=1 then x#=x#+sin(cy#+180)*10
if downkey()=1 then z#=z#+cos(cy#+180)*10
if leftkey()=1 then x#=x#+sin(cy#-90)*10
if leftkey()=1 then z#=z#+cos(cy#-90)*10
if rightkey()=1 then x#=x#+sin(cy#+90)*10
if rightkey()=1 then z#=z#+cos(cy#+90)*10
y#=get ground height(1,x#,z#)
position camera x#,y#+height,z#
ink rgb(255,0,0),0
line 320,230,320,250
line 310,240,330,240
circle 320,240,7
sync
loop
I don't have any source code for a lens flare, but you might try starting off with a hidden object where the sun is, then using object screen x() and object screen y(), and using that in conjunction with the x and y coordinates of the centre of the screen.
Once I was but the learner,
now, I am the Master.