sync on
 
repeat
Print "The current time is ",get time$()
Print "Press the spacebar to continue "
sync
cls
until spacekey()=1
 
cls
 
`specify the time wanted (must be in 24 hour time and in hrs:mins:secs)
Input "What time would you like me to go off at?>",alarmtime$
 
`disgard space before time
alarmtime$=right$(alarmtime$,len(alarmtime$)-1)
 
 
`Alarm Backing
create bitmap 4,80,80
cls rgb(255,255,0)
ink rgb(255,0,0),0
 
for a=1 to 100
dot rnd(80),rnd(80)
next a
 
flip bitmap 4
mirror bitmap 4
 
 
get image 4,0,0,40,45
 
set current bitmap 0
 
`Alarm Object texture
create bitmap 5,55,15
cls rgb(255,255,0)
ink rgb(255,0,0),0
set Text size 3
Print "*BEEP*"
 
get image 5,0,0,50,15
 
set current bitmap 0
 
ink rgb(255,255,255),0
 
`hour block
make object cube 1,5
 
`minutes block
make object cube 2,5
 
`seconds block
make object cube 3,5
 
`alarm object
make object plain 4,20,5
 
color object 4,rgb(10,10,215)
 
 
`move blocks into a readable order
position object 1,-10,0,0
 
position object 3,10,0,0
 
position camera 0,5,-20
 
position object 4,0,-10,0
 
do
 
   ` get time
   time$ = get Time$()
   hours$ = left$(time$, 2)
   minutes$ = left$(right$(time$, 5), 2)
   seconds$ = right$(time$, 2)
 
`Alarm System
   if time$=alarmtime$
     texture backdrop 4
     texture object 4,5
   endif
 
 
`prepare texture for the hours block
  Gosub Hours
 
rem Suggestion by Latch - get rid of these extra gosubs and only Gosub Hours
`prepare texture for the minutes block
`  Gosub Minutes
 
`prepare texture for the seconds block
`  Gosub Seconds
 
 
 
 
turn object left 1,3
turn object left 2,7
turn object left 3,10
 
sync
loop
 
 
`Make hrs texture
Hours:
 
create bitmap 1,25,25
cls rgb(255,10,50)
set text size 10
text 5,5,hours$
flip bitmap 1
mirror bitmap 1
 
get image 1,0,0,20,25
 
Texture object 1,1
`Return
 
 
Minutes:
 
 
cls rgb(10,255,50)
set text size 10
text 5,5,minutes$
 
flip bitmap 1
mirror bitmap 1
 
get image 2,0,0,20,25
 
 
 
Texture object 2,2
`Return
 
Seconds:
 
cls rgb(50,30,10)
set text size 10
text 5,5,seconds$
 
flip bitmap 1
mirror bitmap 1
 
get image 3,0,0,20,25
 
set current bitmap 0
 
Texture object 3,3
 
rem just one retrun at the end of the Hours ,minutes seconds should suffice
rem because they all update at once so you don't have to keep
rem jumping back and forth
 
Return