'=========================================================================== ' Subject: TORCH WHOLE SCREEN Date: 08-21-98 (17:07) ' Author: Anders Olofsson Code: QB, QBasic, PDS ' Origin: anders.olofsson@mail.bip.net Packet: GRAPHICS.ABC '=========================================================================== ' Slightly modified "flames.bas" renamed to "fire.bas", by Anders Olofsson. ' ' E-mail: anders.olofsson@mail.bip.net ' anders.olofsson@zonline.ostersund.se ' ' Compile for best performance. ' DEFINT A-Z DECLARE SUB Palet (Attr%, Red%, Green%, Blue%) DECLARE SUB fPRINT (sx%, Y%, Text$, C%) CONST StartX = 0, StartY = 0 CONST EndX = 319, EndY = 199 SCREEN 13: RANDOMIZE TIMER ' Set palette FOR A = 1 TO 63 Palet A, A, 0, 0: Palet A + 63, 63, A, 0: Palet A + 126, 63, 63, A NEXT A ' Change "LONG" at the DIM YBase line to "INTEGER" ' when you're going to compile this thing... DIM YBase(0 TO 200) AS LONG 'For high speed... FOR Y = 0 TO 200: YBase(Y) = 320& * Y: NEXT DEF SEG = &HA000 LINE (55, 100)-(275, 100), 145 FOR Y = 99 TO 50 STEP -1 LINE (55, Y)-(275, Y), PEEK(320& * (Y + 1) + 175) - 1 NEXT fPRINT 114, 60, "Fire effect", 0: fPRINT 115, 60, "Fire effect", 70 fPRINT 69, 80, "By Anders Olofsson, 1998", 0: fPRINT 70, 80, "By Anders Olofsson, 1998", 70 fPRINT 50, 120, "Press any key to burn this!", 140 WHILE LEN(INKEY$): WEND DO: LOOP UNTIL LEN(INKEY$) DEF SEG = &HA000 DO FOR Y = EndY TO StartY + 1 STEP -1 FOR X = StartX TO EndX C = (PEEK(YBase(Y + 1) + X) + PEEK(YBase(Y - 1) + X) + PEEK(YBase(Y) + X + 1) + PEEK(YBase(Y) + X - 1)) \ 4 - 1 POKE YBase(Y) + X, C NEXT NEXT LOOP UNTIL LEN(INKEY$) DEF SEG WIDTH 80, 25: COLOR 14, 4: LOCATE 1, 2: PRINT " Fire plasma effect " COLOR 7, 0: PRINT "By Anders Olofsson, 1998." END DEFSNG A-Z SUB fPRINT (sx%, Y%, Text$, C%) X% = sx% DEF SEG = &HF000 FOR T% = 1 TO LEN(Text$) FOR ty% = Y% TO Y% + 7 mask% = PEEK(&HFA63 + (ASC(MID$(Text$, T%, 1)) * 8) + 11 + ty% - Y%) * 128 LINE (X%, ty%)-STEP(7, 0), C%, , mask% NEXT X% = X% + 8 NEXT DEF SEG END SUB DEFINT A-Z SUB Palet (Attr%, Red%, Green%, Blue%) OUT &H3C8, Attr% OUT &H3C9, Red% OUT &H3C9, Green% OUT &H3C9, Blue% END SUB