REM :: TENSHIN SOFT :: 2004
REM :: AUTHOR: KUDOU-YUSAKU
sync on : sync rate 0
fog on : fog distance 8000
hide mouse : autocam off
set camera range 10,10000
rem Make a sphere and set culling on to show both sides so we can see the inside.
make object sphere 1,9000
set object 1,1,1,0
color object 1,rgb(150,180,255)
rem Put some random objects around the level so you can see the change of light better
for o=2 to 20
make object cube o,25
position object o,rnd(100*o),12.5,rnd(100*o)
next o
rem Make an Extra Light
make light 1 : set directional light 1,1,-1,1
color light 1,rgb(0,0,50)
rem Make a matrix to move on
make matrix 1,3000,3000,3,3
rem If you are going to use a save game function, then take out this next line
rem ... and use the variable you load from that instead. Otherwise, the default
rem ... time starts at 2AM here, just because.
oclock=2
rem This is used to help count the days correctly.
day=1
do
rem Print Values
set text font "Verdana"
ink rgb(255,255,255),1
set text to bold
set text size 20
set text to italic
oclock$=str$(oclock)
rt2$=str$(realtime#)
amb$=str$(amb#)
rgb$=str$(rgb#)
ls$=str$(lspeed#)
fps$=str$(fps#)
days$=str$(day-1)
hr$=str$(hr)
`center text 320,25,"Framerate: "+fps$
text 25,25,oclock$+":"+rt$+" "+xm$
text 25,50,"Hours: "+hr$
text 25,75,"Days: "+days$
rem Positoin Camera
position camera cx#,10,cz#
yrotate camera ca#
rem Move the camera around with this
if upkey()=1 then cx#=newxvalue(cx#,ca#,1):cz#=newzvalue(cz#,ca#,1)
if downkey()=1 then cx#=newxvalue(cx#,ca#,-1):cz#=newzvalue(cz#,ca#,-1)
if leftkey()=1 then ca#=wrapvalue(ca#-1)
if rightkey()=1 then ca#=wrapvalue(ca#+1)
rem Call on the time control
GOSUB TIME_CONTROL
sync
loop
rem This is the real-time Day/Night Simulator
TIME_CONTROL:
`TIMESPEED# DEFAULT = 0.025 (1 SECOND = 1 GAME MINUTE)
`...0.5 USED TO SHOW TIME FASTER
timespeed#=0.5 : REM :: ALTER THE TIMESPEED# TO CHANGE HOW TIME'S PACE
realtime#=realtime#+timespeed#
if lsd=0
lspeed#=lspeed#+(timespeed#*0.1)
` if lspeed#=>60 then lsd=1
endif
if lsd=1
lspeed#=lspeed#-(timespeed#*0.15)
` if lspeed#<=0 then lsd=0
endif
if lsd=2
amb#=10
endif
if oclock=>6 and oclock=<17 then lsd=0
if oclock=>18 and oclock=<23 then lsd=1
if oclock=>0 and oclock=<1 then lsd=1
if oclock=>2 and oclock=<5 then lsd=2
if realtime#=>0 then rt$="00" : if realtime#=>1 then rt$="01"
if realtime#=>2 then rt$="02" : if realtime#=>3 then rt$="03"
if realtime#=>4 then rt$="04" : if realtime#=>5 then rt$="05"
if realtime#=>6 then rt$="06" : if realtime#=>7 then rt$="07"
if realtime#=>8 then rt$="08" : if realtime#=>9 then rt$="09"
if realtime#=>10 then rt$="10" : if realtime#=>11 then rt$="11"
if realtime#=>12 then rt$="12" : if realtime#=>13 then rt$="13"
if realtime#=>14 then rt$="14" : if realtime#=>15 then rt$="15"
if realtime#=>16 then rt$="16"
if realtime#=>17 then rt$="17" : if realtime#=>18 then rt$="18"
if realtime#=>19 then rt$="19" : if realtime#=>20 then rt$="20"
if realtime#=>21 then rt$="21" : if realtime#=>22 then rt$="22"
if realtime#=>23 then rt$="23" : if realtime#=>24 then rt$="24"
if realtime#=>25 then rt$="25" : if realtime#=>26 then rt$="26"
if realtime#=>27 then rt$="27" : if realtime#=>28 then rt$="28"
if realtime#=>29 then rt$="29" : if realtime#=>30 then rt$="30"
if realtime#=>31 then rt$="31" : if realtime#=>32 then rt$="32"
if realtime#=>33 then rt$="33" : if realtime#=>34 then rt$="34"
if realtime#=>35 then rt$="35" : if realtime#=>36 then rt$="36"
if realtime#=>37 then rt$="37" : if realtime#=>38 then rt$="38"
if realtime#=>39 then rt$="39" : if realtime#=>40 then rt$="40"
if realtime#=>41 then rt$="41" : if realtime#=>42 then rt$="42"
if realtime#=>43 then rt$="43" : if realtime#=>44 then rt$="44"
if realtime#=>45 then rt$="45" : if realtime#=>46 then rt$="46"
if realtime#=>47 then rt$="47" : if realtime#=>48 then rt$="48"
if realtime#=>49 then rt$="49" : if realtime#=>50 then rt$="50"
if realtime#=>51 then rt$="51" : if realtime#=>52 then rt$="52"
if realtime#=>53 then rt$="53" : if realtime#=>54 then rt$="54"
if realtime#=>55 then rt$="55" : if realtime#=>56 then rt$="56"
if realtime#=>57 then rt$="57" : if realtime#=>58 then rt$="58"
if realtime#=>59 then rt$="59" : if realtime#=>60 then oclock=oclock+1 : realtime#=0
if oclock=24 then oclock=0
if oclock=>0 and oclock=<11 then xm$="AM"
if oclock=>12 and oclock=<23 then xm$="PM"
if realtime#=0 then hr=hr+1
if oclock=4 and dstop=0 then day=day+1 : dstop=1
if oclock>4 then dstop=0
amb#=10+lspeed#*1.5
rgb#=lspeed#*1.5
rl#=rl#+lspeed#+2.2
fog color rgb(rgb#,rgb#*1.25,rgb#*2)
color light 0,rgb(rgb#*1.5,rgb#,rgb#)
if rgb#<0 then rgb#=0
if rgb#>255 then rgb#=255
if oclock=>15 and oclock=<20 then color light 1,rgb(80,0,0)
if oclock=>21 and oclock=<23 then color light 1,rgb(0,0,80+rgb#*-2)
if oclock<1 then color light 1,rgb(0,0,30)
if oclock=>5 and oclock=<14 then color light 1,rgb(20+rgb#*2,0,0)
if amb#=<10 then amb#=10
if amb#=>80 then amb#=80
set ambient light amb#
RETURN