'=========================================================================== ' Subject: WIDE FIRE Date: 05-21-97 (14:55) ' Author: Jim Emptage Code: QB, QBasic, PDS ' Origin: 75504.2526@compuserve.com Packet: GRAPHICS.ABC '=========================================================================== ' fire routine by Jim Emptage ' 75504.2526@compuserve.com ' even a wide fire works fairly well on my ' 486 66 computer ' uses colors 1 to 60 ' use the rest of the colors for your other ' program needs ' you could add a check so the fire does not ' cover colors over 60, even if in fire box CLS SCREEN 13 DEFINT A-Z FOR A = 1 TO 60 PALETTE A, A NEXT sx = 10 ' LEFT X POS SY = 135 ' BOTTOM Y POS xmax = 300 ' X WIDTH ' Y HIGHT IS 65 LINE (sx - 1, SY + 1)-(sx + (xmax + 1), SY - 66), 141, B ' this line describes the fire box PAINT (1, 1), 190, 141 DO REDIM sam(xmax, 65) RANDOMIZE TIMER IF UP = 0 THEN T = 1 + INT(RND * (xmax - 1)) IF UP = 1 THEN T = 3 + INT(RND * (xmax - 3)) IF T = 1 THEN UP = 1 FOR A = 0 TO xmax STEP T clr = 30 + (RND * 30) sam(A, 0) = clr NEXT FOR x = 0 TO xmax STEP T FOR y = 0 TO 64 IF sam(x, y) <> 0 THEN IF sam(x, y + 1) = 0 THEN sam(x, y + 1) = ABS(sam(x, y) - 1) END IF END IF NEXT NEXT FOR y = 0 TO 65 FOR x = 0 TO xmax STEP T clr = (sam(x, y)) IF clr < 0 THEN clr = 0 PSET (x + sx, SY - y), clr NEXT NEXT LOOP WHILE INKEY$ = ""