'=========================================================================== ' Subject: QBASIC SNOW V1.22 Date: 06-03-00 (01:43) ' Author: Caleb Cassel Code: QB, QBasic, PDS ' Origin: ryuse@tcgcs.com Packet: GRAPHICS.ABC '=========================================================================== 'Qbasic Snow 'Version 1.22 '(c) 1997 Caleb Cassel ' ' This program is freeware and does not cost anything to own. You can 'change anything you like as long as it is distributed in its original form 'only. ' ' I apologize for not writing this so it's more self explanable but I 'hate to go through my programs and add comments. :) You'll have to figure 'out how it works if you really want to know. ' ' Caleb Cassel ' ryuse@tcgcs.com ' 'Updates: Version 1.20 ' * Reduced the flicker that is caused by adding ' too many flakes. This has allowed me to add ' many more. ' ' * Added a subroutine which helps add realism to ' the look of how it piles. ' ' Version 1.21 ' * Small bug fixes and revisions. ' ' Version 1.22 ' * Slightly smoother animation. ' * Random amounts of flakes. DEFINT A-Z DECLARE SUB manage () DECLARE SUB snow () COMMON SHARED n% SCREEN 7, , 1, 0 RANDOMIZE TIMER n% = INT(RND * 4) + 1 SELECT CASE n% CASE 1 n% = 75 CASE 2 n% = 90 CASE 3 n% = 100 CASE 4 n% = 110 END SELECT DIM SHARED snowx(n%) AS INTEGER DIM SHARED snowy(n%) AS INTEGER DIM SHARED Speed(n%) AS INTEGER DIM SHARED oldsnowx(n%) AS INTEGER DIM SHARED oldsnowy(n%) AS INTEGER DIM SHARED colors(n%) AS INTEGER DIM SHARED stack(320) AS INTEGER FOR I = 2 TO 319 stack(I) = 199 NEXT I FOR I = 1 TO n% 6 snowx(I) = (RND * 318) + 2 IF snowx(I) = 320 THEN GOTO 6 snowy(I) = (RND * 200) + 1 Speed(I) = ((RND * 3) + 1) colors(I) = (RND * 15) + 1 IF colors(I) = 15 THEN CIRCLE (snowx(I), snowy(I)), 1, 3 ELSE CIRCLE (snowx(I), snowy(I)), 1, 7 END IF NEXT I PCOPY 1, 0 30 DO snow manage WAIT &H3DA, 8 PCOPY 1, 0 LOOP UNTIL LEN(INKEY$) SYSTEM SUB manage FOR e = 2 TO 319 IF stack(e - 1) - 2 = stack(e) THEN CIRCLE (e, stack(e)), 1, 0 stack(e) = stack(e) + 1 CIRCLE ((e - 1), stack((e - 1)) + 1), 1, 7 stack((e - 1)) = stack((e - 1)) - 1 END IF NEXT e FOR e = 2 TO 318 IF stack(e + 1) - 2 = stack(e) THEN CIRCLE (e, stack(e)), 1, 0 stack(e) = stack(e) + 1 CIRCLE ((e + 1), stack((e + 1)) + 1), 1, 7 stack((e + 1)) = stack((e + 1)) - 1 END IF NEXT e END SUB SUB snow FOR I = 1 TO n% IF snowy(I) < stack(snowx(I)) THEN oldsnowx(I) = snowx(I) oldsnowy(I) = snowy(I) snowy(I) = snowy(I) + Speed(I) CIRCLE (oldsnowx(I), oldsnowy(I)), 1, 0 IF colors(I) = 15 THEN CIRCLE (snowx(I), snowy(I)), 1, 3 ELSE CIRCLE (snowx(I), snowy(I)), 1, 7 END IF ELSE IF stack(snowx(I)) = 80 THEN FOR e = 2 TO 319 stack(e) = 199 NEXT e CLS END IF IF colors(I) = 15 THEN CIRCLE (snowx(I), stack(snowx(I))), 1, 3 IF colors(I) < 15 THEN CIRCLE (snowx(I), stack(snowx(I))), 1, 7 stack(snowx(I)) = stack(snowx(I)) - 1 5 snowx(I) = (RND * 318) + 2 IF snowx(I) = 320 THEN GOTO 5 Speed(I) = ((RND * 3) + 1) snowy(I) = (0 + Speed(I)) - 1 colors(I) = (RND * 15) + 1 IF colors(I) = 15 THEN CIRCLE (snowx(I), snowy(I)), 1, 3 ELSE CIRCLE (snowx(I), snowy(I)), 1, 7 END IF END IF NEXT I END SUB