here is an idea about a flickering light
_______TOP_______:
rem Generic Template
rem Player = object 10
rem Cubes = objects 100-120
_____INITIALIZE_____:
set display mode 1024,768,32
SYNC ON
SYNC RATE 60
backdrop on
color backdrop rgb(10,100,100)
set text opaque
autocam off
hide mouse
set global collision off
x#=1200.0:z#=1000.0:a#=0.0:s#=0.0:h#=0.0
cx#=0.0:cy#=0.0:cz#=0.0:ca#=0.0:camght=50
campointh=0:camdist=0
objnum=100:fade=10
gosub Setupland1
gosub makeplayer
gosub makeobjects
gosub makelight
rem gosub makespheres
gosub ambient
gosub resetcam
_____DO_LOOP_____:
do
if x#<100 then x#=100
if z#<100 then z#=100
if x#>landsize-100 then x#=landsize-100
if z#>landsize-100 then z#=landsize-100
collx#=x#:collz#=z#
if inkey$()="e" then sync rate 0
if inkey$()="E" then sync rate 60
gosub printdata
gosub camera_control
gosub Playercontrol
gosub lightflicker
SYNC
loop
_______LIGHT_ROUTINE____:
lightflicker:
ramp=ramp+1
set light range 1,ramp*20+500
if ramp>fade then fade=rnd(50):ramp=1
return
_____CONTROL_PLAYER___:
Playercontrol:
rem ---- Control Character ----
x#=newxvalue(x#,a#,s#)
z#=newzvalue(z#,a#,s#)
h#=get ground height(1,x#,z#)
position object 10,x#,h#+10,z#
yrotate object 10,a#
if upkey()=1 and s#<8 then s#=s#+0.1
if downkey()=1 and s#>-8 then s#=s#-0.2
if leftkey()=1 then a#=wrapvalue(a#-1)
if rightkey()=1 then a#=wrapvalue(a#+1)
if inkey$()="ù" then s#=0.0
if inkey$()="à" then s#=10.0
return
______CAMERA_ROUTINES____:
rem -------CAMERA--------
camera_control:
mymousey=mousemovey()
if mymousey>0 then campointh=campointh+3
if mymousey<0 then campointh=campointh-3
mymousez=mousemovez()
if mymousez>0 then camdist=camdist+10
if mymousez<0 then camdist=camdist-10
rem camera update
position mouse 300,300
rem Position camera to the back of the character
ca#=wrapvalue(a#+camrot)
cx#=newxvalue(x#,ca#,camdist)
cz#=newzvalue(z#,ca#,camdist)
cy#=h#
position camera cx#,cy#+camhgt,cz#
rem Point camera at object
point camera x#,h#+camhgt+campointh,z#
return
rem camera reset
Resetcam:
set camera range 1,20000
camdist=-150
camhgt=60
camrot=0
camlen=0
return
____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 2,2,2,250
line 0,0,250,0
line 1,1,250,1
line 2,2,250,2
line 0,0,250,250
line 0,250,250,0
rem next n
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
rem ***********
rem get ground done
update matrix 1
return
_____PRINT_ON__SCREEN___:
printdata:
set cursor 0,0
print "Polys=",statistic(1)
print "FPS=",screen fps()
print "player x#= ",x#
print "player h#= ",h#
print "player z#= ",z#
return
____MAKE_OBJECTS____:
rem -------------Characters-Objects------------
makeplayer:
make object cube 10,20
return
makeobjects:
make object sphere 99,20
position object 99,1350,200,1350
set object 99,1,1,0,0,0,0
ghost object on 99
return
rem ------------------ambient----------------
_______AMBIENT_______:
ambient:
set ambient light 10
hide light 0
fog on
fog color rgb(150,150,200)
fog distance 10000
return
makelight:
make light 1
set point light 1,1350,200,1350
set light range 1,2000
return
end