'=========================================================================== ' Subject: FRENZIED LIGHTNING STORM Date: 05-19-97 (15:34) ' Author: Matthew Pulley Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== ' Here's my latest contribution to the 3AM series. Pretty cool effect. 'Compile it and run with the command line "/FRENZY". Big Storm. I might add 'rain to it a little later. Enjoy! DEFINT A-Z DECLARE SUB Flash () DECLARE SUB MilliDelay (msecs) RANDOMIZE TIMER SCREEN 13 IF INSTR(COMMAND$, "/FRENZY") THEN Speed = 1000 ELSE Speed = 5000 Shade(1) = 57 Shade(2) = 32 XAdd(1) = -1 XAdd(2) = 1 DO X = INT(RND * 310) Fork1 = INT(RND * 50 + 20) Fork2 = INT(RND * 100 + 50) Fork3 = INT(RND * 150 + 100) Fork4 = INT(RND * 150 + 125) FOR y = 0 TO 199 LINE (X + XAdd, y)-(X + XAdd, y), 15 LINE (X + XAdd - 1, y)-(X + XAdd - 1, y), 15 LINE (X + XAdd - 2, y)-(X + XAdd - 2, y), Shade(Colr) LINE (X + XAdd + 1, y)-(X + XAdd + 1, y), 15 LINE (X + XAdd + 2, y)-(X + XAdd + 2, y), Shade(Colr) IF y = Fork1 THEN Length = RND * 50 LINE (X + XAdd, y)-(X + Length, y + Fork1), 15 END IF IF y = Fork2 THEN Length = RND * 50 LINE (X + XAdd, y)-(X - Length, y + Fork2), 15 END IF IF y = Fork3 THEN Length = RND * 50 LINE (X + XAdd, y)-(X - Length, y + Fork3), 15 END IF IF y = Fork4 THEN Length = RND * 50 LINE (X + XAdd, y)-(X + Length, y + Fork4), 15 END IF X = X + XAdd(RND * 2 + 1) IF X > 319 THEN X = X + XAdd(1) IF X < 0 THEN X = X + XAdd(2) NEXT Colr = INT(RND * 2 + 1) RandPick = INT(RND * 2 + 1) IF RandPick = 1 THEN Flash CLS IF INKEY$ <> "" THEN END MilliDelay RND * Speed LOOP SUB Flash OUT &H3C8, 0 OUT &H3C9, 63 OUT &H3C9, 63 OUT &H3C9, 63 MilliDelay 50 OUT &H3C8, 0 OUT &H3C9, 0 OUT &H3C9, 0 OUT &H3C9, 0 END SUB SUB MilliDelay (msecs) STATIC IF sysfact& THEN IF msecs THEN Count& = (sysfact& * msecs) \ -54 DO Count& = Count& + 1 IF Count& = Z THEN EXIT DO IF INKEY$ <> "" THEN END LOOP UNTIL t2 = PEEK(&H6C) END IF ELSE DEF SEG = &H40 t1 = PEEK(&H6C) DO t2 = PEEK(&H6C) IF INKEY$ <> "" THEN END LOOP UNTIL t2 <> t1 DO sysfact& = sysfact& + 1 IF sysfact& = Z THEN EXIT DO IF INKEY$ <> "" THEN END LOOP UNTIL t2 <> PEEK(&H6C) t2 = 256 END IF END SUB