'=========================================================================== ' Subject: BIDIRECTIONAL CIRCLE PLASMA Date: 08-02-97 (20:02) ' Author: Davey W. Taylor Code: QB, QBasic, PDS ' Origin: audio.squad@mailbox.swipnet.se Packet: GRAPHICS.ABC '=========================================================================== 'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ--ÄÄÄ--Ä -ù ù '³ ** PLASMA EFFECT ** '³ Created by Davey W Taylor '³ '³ Please mention my name if you use this code in your program! 'ÀÄÄÄÄÄ--ÄÄù- ù ù ' ** If you have any comments / suggestions / questions, my email is: ** ' ** audio.squad@mailbox.swipnet.se ** DECLARE SUB setpal (Attr%, Red%, Green%, Blue%) DECLARE SUB getPal (Attr%, Red%, Green%, Blue%) SCREEN 13 'Gee... FOR o% = 0 TO 63 'Set a rainbow palette setpal n% + o%, o% - 1, 0, 63 NEXT o% n% = n% + 64 FOR o% = 0 TO 63 setpal n% + o%, 63, o% - 1, 63 - o% NEXT o% n% = n% + 64 FOR o% = 0 TO 63 setpal n% + o%, 63, 63 - o%, 0 NEXT o% n% = n% + 64 FOR o% = 0 TO 63 setpal n% + o%, 63 - o%, 0, o% - 1 NEXT o% setpal 0, 0, 0, 0 'Fix missed colors setpal 64, 63, 0, 63 setpal 128, 63, 63, 0 setpal 192, 63, 0, 0 FOR n% = 1 TO 162 STEP 2 'Draw the circle bidirectional pattern c% = (c% + 1) MOD 256 IF c% = 0 THEN c% = 1 CIRCLE (159, 99), n%, c% CIRCLE (159, 100), n%, c% CIRCLE (160, 99), n%, c% CIRCLE (159, 98), n%, c% CIRCLE (158, 99), n%, c% NEXT n% DIM lin(1 TO 162, 200) AS INTEGER FOR n% = 1 TO 200 STEP 2 GET (0, n% - 1)-(319, n% - 1), lin(1, n%) NEXT n% FOR n% = 1 TO 162 STEP 2 c% = (c% + 1) MOD 256 IF c% = 0 THEN c% = 1 CIRCLE (159, 99), n%, 255 - c% CIRCLE (159, 100), n%, 255 - c% CIRCLE (160, 99), n%, 255 - c% CIRCLE (159, 98), n%, 255 - c% CIRCLE (158, 99), n%, 255 - c% NEXT n% FOR n% = 1 TO 200 STEP 2 PUT (0, n% - 1), lin(1, n%), PSET NEXT n% LINE (0, 0)-(319, 19), 0, BF 'Clear the sides LINE (0, 180)-(319, 199), 0, BF LINE (0, 0)-(29, 199), 0, BF 'Clear top and bottom LINE (290, 0)-(319, 199), 0, BF LINE (29, 19)-(290, 180), 1, B 'Draw a border LOCATE 1, 9 PRINT "Plasma by Davey W Taylor" DO WAIT &H3DA, 8 'Wait for screen retrace getPal 1, rr%, gr%, br% 'Rotate ' - the safest way to make FOR n% = 2 TO 255 ' - the ' - a delay in a program getPal n%, r%, g%, B% ' - palette setpal n% - 1, r%, g%, B% NEXT n% setpal 255, rr%, gr%, br% LOOP WHILE INKEY$ = "" SUB getPal (Attr%, Red%, Green%, Blue%) OUT &H3C7, Attr% OUT &H3C8, Attr% Red% = INP(&H3C9) Green% = INP(&H3C9) Blue% = INP(&H3C9) END SUB SUB setpal (Attr%, Red%, Green%, Blue%) OUT &H3C7, Attr% OUT &H3C8, Attr% OUT &H3C9, Red% OUT &H3C9, Green% OUT &H3C9, Blue% END SUB