' Program: Stars w/ Time
' Creator: Cloud Zimmermann
' Created: 1/7/2020
'slight modification by Cobalt on 5/16/2020 to make it a rainy day. everything but the lightning :-(
'SCREEN 7, 0, 0, 1
'lets cover the basics!
'lets make the screen a little bigger and give ourselves more color room.
'make a temp layer to draw upon, to simulate screen 7 layers
_DELAY .1 'wait a moment for screen to materialize! _TITLE "Rainy Day Screen Saver!"
'move this here to cover new random items
quit% = 0
'swapping our variable types to allow for more variation
'lets allow the clock to start in other locations
'add a bit of variance to our rainy day(increased base to help with larger screen area)
Star
(i%
).x
= INT(RND * 640) + 1 Star
(i%
).y
= INT(RND * 480) + 1 'make the rain shades of blue(brightened a bit to make it easier to see).
Star
(i%
).c
= _RGB32(16, INT(RND * 80) + 32, (32 + INT(Star
(i%
).z
* 96)) + 48)
_DEST Temp&
'draw everything to the temp layer( like screen 7's layer 1)
Star(i%).y = Star(i%).y + Star(i%).z
Star(i%).z = Star(i%).z * 1.05
PSET (Star
(i%
).x
, Star
(i%
).y
), Star
(i%
).c
'resetting the drops height when it reaches the "ground" and vary its velocity
'and move the drop to a new x location
IF Star
(i%
).y
> 480 THEN Star
(i%
).y
= Star
(i%
).y
- 480: Star
(i%
).z
= (RND * 2.5): Star
(i%
).x
= INT(RND * 640) + 1
'LOCATE 5, 5: COLOR 3
'PRINT TIME$
DrawClock clock 'don't need CALL anymore
' PCOPY 0, 1
'_DELAY .5
SUB DrawClock
(clock
AS ClockType
) ' tmp$ = TIME$
' FOR pointer% = 1 TO LEN(tmp$)
' digit% = VAL(MID$(tmp$, pointer%, 1))
' CALL DrawDigit(digit%, pointer%, clock.x, clock.y)
' NEXT pointer%
DrawTime clock.x, clock.y 'not as clever as DrawDigit, but very simple
'PSET (clock.x, clock.y), clock.c
'simple!
'clock.x = clock.x + clock.dx
'clock.y = clock.y + clock.dy
'IF clock.x <= 0 OR clock.x >= 640 - 64 THEN clock.dx = -clock.dx
'IF clock.y <= 0 OR clock.y >= 480 - 12 THEN clock.dy = -clock.dy
'not so simple
IF clock.x
<= 2 THEN X_Flag%%
= FALSE: clock.dx
= RND * 3 + .5 IF clock.x
>= 640 - 64 THEN X_Flag%%
= TRUE: clock.dx
= RND * 3 + .5 IF clock.y
<= 2 THEN Y_Flag%%
= FALSE: clock.dy
= RND * 3 + .5 IF clock.y
>= 480 - 12 THEN Y_Flag%%
= TRUE: clock.dy
= RND * 3 + .5 IF X_Flag%%
= TRUE
THEN clock.x
= clock.x
- clock.dx
ELSE clock.x
= clock.x
+ clock.dx
IF Y_Flag%%
= TRUE
THEN clock.y
= clock.y
- clock.dy
ELSE clock.y
= clock.y
+ clock.dy
TimeColor~&
= _RGB32(0, 112, 192) 'now using 32bit colors we need to make our clock color 'only thing missing is the `:`? Numbers look really good, I think anyway!
tmp$
= "BC" + STR$(TimeColor~&
) + "M" + STR$(x
) + "," + STR$(y
) + " BM+" + STR$(5 * p
) + ",0" IF d
= 1 THEN tmp$
= tmp$
+ "BM+3,0D4" IF d
= 2 THEN tmp$
= tmp$
+ "R3D2L3D2R3" IF d
= 3 THEN tmp$
= tmp$
+ "R3D2L3R3D2L3" IF d
= 4 THEN tmp$
= tmp$
+ "D2R3U2D4" IF d
= 5 THEN tmp$
= tmp$
+ "BM+3,0L3D2R3D2L3" IF d
= 6 THEN tmp$
= tmp$
+ "BM+3,0L3D4R3U2L3" IF d
= 7 THEN tmp$
= tmp$
+ "R3D4" IF d
= 8 THEN tmp$
= tmp$
+ "R3D4L3U4D2R3" IF d
= 9 THEN tmp$
= tmp$
+ "R3L3D2R3U2D4" IF d
= 0 THEN tmp$
= tmp$
+ "R3D4L3U4"