'=========================================================================== ' Subject: COLORFUL SCREEN SAVER Date: 05-13-97 (00:00) ' Author: Duct_Tape Code: QB, QBasic, PDS ' Origin: ducttape@info2000.net Packet: GRAPHICS.ABC '=========================================================================== '--------------------------------------------------' 'All of this source code was written by Duct_Tape ' '--------------------------------------------------' 'If you think of a name for this screen saver then ' 'email me. Or If you would like for me to explain ' 'it to you then email me - ducttape@info2000.net ' '--------------------------------------------------' 'Duct_Tape's QBasic Page ' 'http://www.geocities.com/Area51/Cavern/4315 ' 'http://duct-tape.home.ml.org ' '--------------------------------------------------' DECLARE SUB pal.set (lo%, hi%, red%, green%, blue%, r%, g%, b%) DECLARE SUB write.pal (r%, g%, b%, c%) DECLARE SUB get.pal (r%, g%, b%, c%) DECLARE SUB pal.fadeout () DECLARE SUB pal.cycle () COMMON SHARED x, y, x2, y2, x3, y3, c SCREEN 13: CLS RANDOMIZE TIMER x = 1: y = 1 'x2 = 50: y2 = 75 'x3 = 300: y3 = 119 x2 = INT(RND * 280) + 20: y2 = INT(RND * 160) + 20 x3 = INT(RND * 280) + 20: y3 = INT(RND * 160) + 20 c = 2 FOR c = 1 TO 7 READ lo%, hi%, red%, green%, blue%, r%, g%, b% CALL pal.set(lo%, hi%, red%, green%, blue%, r%, g%, b%) NEXT c DO LINE (0, y)-(320, y), col - 1 y = y + 1: IF y > 199 THEN y = 0: col = 1 col = col + 1 IF col > 155 THEN col = 2 LOOP UNTIL y = 199 CALL pal.cycle CALL pal.fadeout SYSTEM DATA 1, 22, 0, 0, 0, 3, 0, 0 DATA 23, 44, 0, 0, 0, 3, 1, 0 DATA 45, 66, 0, 0, 0, 3, 3, 0 DATA 67, 88, 0, 0, 0, 0, 3, 1 DATA 89, 110, 0, 0, 0, 0, 3, 3 DATA 111, 132, 0, 0, 0, 0, 1, 3 DATA 133, 154, 0, 0, 0, 3, 0, 3 SUB get.pal (r%, g%, b%, c%) OUT &H3C7, c% r% = INP(&H3C9) g% = INP(&H3C9) b% = INP(&H3C9) END SUB SUB pal.cycle DO IF NOT xdir THEN x2 = x2 + 1: IF x2 >= 310 THEN xdir = -1 IF xdir THEN x2 = x2 - 1: IF x2 <= 10 THEN xdir = 0 IF NOT ydir THEN y2 = y2 + 1: IF y2 >= 191 THEN ydir = -1 IF ydir THEN y2 = y2 - 1: IF y2 <= 10 THEN ydir = 0 IF NOT x2dir THEN x3 = x3 + 1: IF x3 >= 295 THEN x2dir = -1 IF x2dir THEN x3 = x3 - 1: IF x3 <= 0 THEN x2dir = 0 IF NOT y2dir THEN y3 = y3 + 1: IF y3 >= 194 THEN y2dir = -1 IF y2dir THEN y3 = y3 - 1: IF y3 <= 3 THEN y2dir = 0 CIRCLE (x2, y2), 10, c PAINT (x2, y2), c LINE (x3, y3)-(x3 + 25, y3 + 5), c, BF IF c > 153 THEN c = 1 ELSE c = c + 1 CALL get.pal(ro%, go%, bo%, 1) FOR i% = 1 TO 154 CALL get.pal(r%, g%, b%, i% + 1) CALL write.pal(r%, g%, b%, i%) NEXT i% CALL write.pal(ro%, go%, bo%, 154) LOOP UNTIL INKEY$ <> "" END SUB SUB pal.fadeout FOR n% = 1 TO 64 FOR i% = 1 TO 154 CALL get.pal(r%, g%, b%, i%) IF r% > 0 THEN r% = r% - 1 IF g% > 0 THEN g% = g% - 1 IF b% > 0 THEN b% = b% - 1 CALL write.pal(r%, g%, b%, i%) NEXT i% NEXT n% END SUB SUB pal.set (lo%, hi%, red%, green%, blue%, r%, g%, b%) FOR i% = lo% TO hi% OUT &H3C8, i% OUT &H3C9, red% OUT &H3C9, green% OUT &H3C9, blue% red% = red% + r% green% = green% + g% blue% = blue% + b% NEXT i% END SUB SUB write.pal (r%, g%, b%, c%) OUT &H3C8, c% OUT &H3C9, r% OUT &H3C9, g% OUT &H3C9, b% END SUB