'=========================================================================== ' Subject: STANDARD FIRE EFFECT Date: 01-15-97 (01:00) ' Author: Angelo Ken Pesce Code: QB, QBasic, PDS ' Origin: ken@uniserv.uniplan.it Packet: GRAPHICS.ABC '=========================================================================== REM ******************************************************* CONFIG DEFINT A-Z CLS PRINT "FIRE EFFECT" PRINT "APSOFTWARE 1996" INPUT "X DIM (100-320)"; xdim IF xdim > 320 THEN xdim = 320 IF xdim < 100 THEN xdim = 100 INPUT "Y DIM (100-200)"; ydim IF ydim > 200 THEN ydim = 200 IF ydim < 100 THEN ydim = 100 1 INPUT "X SPEED (0-3)"; xvel IF xvel > 3 OR xvel < 0 THEN PRINT "MINIMUM VEL 0, MAXIMUM VEL 3": GOTO 1 2 INPUT "Y SPEED (0-3)"; yvel IF yvel > 3 OR yvel < 0 THEN PRINT "MINIMUM VEL 0, MAXIMUM VEL 3": GOTO 2 INPUT "ITER (5-15)"; iter IF iter > 15 THEN iter = 15 IF iter < 5 THEN iter = 5 INPUT "C Speed (0.1-1)"; b IF b > 1 THEN b = 1 IF b < .1 THEN b = .1 INPUT "X SIZE (1-4)"; xpix INPUT "Y SIZE (1-4)"; ypix IF xpix > 4 THEN xpix = 4 IF xpix < 1 THEN xpix = 1 IF ypix > 4 THEN ypix = 4 IF ypix < 1 THEN ypix = 1 INPUT "Lines (1-30)"; ln IF ln > 30 THEN ln = 30 IF ln < 1 THEN ln = 1 SCREEN 13 REM ******************************************************* PALETTE INIT FOR col = 0 TO 63 PALETTE col, col NEXT REM ******************************************************* RANDOM POINTS DO FOR I = 1 TO ln FOR t% = 1 TO 100 x% = INT(RND * xdim) y% = INT(RND * ydim) x1% = INT(RND * xdim) y1% = INT(RND * ydim) c% = 63 LINE (x%, y%)-(x1%, y1%), c% NEXT t% NEXT REM ******************************************************* FIRE !!! DIM xp, yp, xs, yx, xend, yend AS INTEGER CONST xstart = 0, ystart = 0 xend = xdim yend = ydim CONST cmax = 63 FOR I = 1 TO iter FOR xp = xstart TO xend STEP xpix FOR yp = ystart TO yend STEP ypix col = POINT(xp, yp) col = col + POINT(xp + 1, yp) + POINT(xp, yp + 1) col = col + POINT(xp - 1, yp) + POINT(xp, yp - 1) col = col + POINT(xp + 1, yp + 1) + POINT(xp + 1, yp - 1) col = col + POINT(xp - 1, yp + 1) + POINT(xp - 1, yp - 1) col = INT(col / 9 - b) IF col < 0 THEN col = 0 IF col > cmax THEN col = cmax FOR px = 0 TO xpix - 1 FOR py = 0 TO ypix - 1 PSET (xp - xvel + px, yp - yvel + py), col NEXT NEXT NEXT NEXT NEXT LOOP