hide mouse : color backdrop RGB(0, 0, 0)
sync on : sync rate 35 : draw to front
rem Loading Propmt
cls : center text screen width() / 2, screen height() / 2, "LOADING" : sync
map = 200
make object plain map, 185,185
color object map, rgb(0,255,0)
position object map, -1,0,1
xrotate object map,270
rem Create Hour Markers
for t = 100 to 124
make object cube t, 6
position object t, 0, 0, 0
yrotate object t, wrapvalue(t * 15)
move object t, -100
next t
rem Create Sun, Moon and Arctic Spheres
COLOR LIGHT 0, RGB(100, 100, 100)
make object sphere 14, 8
color object 14, RGB(255, 255, 0)` Sun
MAKE LIGHT 1
SET LIGHT RANGE 1,500
make object sphere 15, 8
color object 15, RGB(100, 100, 100) `Moon
make object sphere 16, 6
position object 16, 0, 0, 0
color object 16, RGB(0, 0, 255) `Arctic
rem Position Camera
position camera 0, 180, 0
point camera 0, 0, 0
Start_or_restart: sunpos = 0: moonpos# = 0
rem Main Loop `__________________________________
day# = 1
Do
rem speed up animation here
for x = 1 to 2
sunpos = sunpos +1: if sunpos = 360 then sunpos = 0: day# = day# + 1
If day# = 32 then day# = 1
month$ = "January"
set cursor 150,80: print month$," ", day#
set text size 12: set cursor 20,20: print "to stop- press Escape key (esc key upper left keyboard)"
rem the moon lags behind the sun, but then lines up with it again 27.32 (star alignment) days later. Therefore:
rem 100(1 hour)- /27.32 = 100-3.66 = 96.34
moonpos# = moonpos# + .9634 : if moonpos# > 360 then moonpos# = 0
next x
rem Sun ball
position object 14, 0, 0, 0
yrotate object 14, sunpos +180
move object 14, -45
set point light 1,OBJECT POSITION X(14),OBJECT POSITION Y(14),OBJECT POSITION Z(14)
rem moon ball
position object 15, 0, 0, 0
yrotate object 15, moonpos# +180
move object 15, -35
rem Update Screen
if SPACEKEY()= 1 then goto start_or_restart
Rem put date
sync
if firstime = 0 then sync: sleep 5000 : firstime = 1 `(show start position)
Loop
.