'=========================================================================== ' Subject: MYSTERY SPEW #2: EXPLOSIONS Date: 01-20-97 (16:40) ' Author: Nick Kochakian Code: QB, QBasic, PDS ' Origin: NickK@worldnet.att.net Packet: GRAPHICS.ABC '=========================================================================== '---------------------------------------------------------------------------- 'Program name: Mystery Spew #2 - Explosions ' 'Date made: 1/20/97, 1997 ' 'Author: - Nick Kochakian - ' 'Changes: '- If you put some text / graphics on the screen the dots will bounce off ' of it. (But, that dosen't work too well...) '- Dots bounce off each other ' 'If you want to use this program in any of your programs please mention 'my name somewhere to give me credit for making it! ' 'If you have any comments or questions please E-mail me at: ' 'nickK@worldnet.att.net ' 'Thanks! :) '---------------------------------------------------------------------------- 'DEFINT A-Z 'Un-comment this to have more dots on high res. modes or low res. RANDOMIZE TIMER MODE = 13 'Low res.: '1 - Cga '7 - Ega '13 - Vga ' 'High res.: '9 - Ega '12 - Vga SCREEN MODE LOCATE 6, 5: PRINT "Mystery Spew!" LOCATE 7, 5: PRINT "1997 By: - Nick Kochakian -" LOCATE 8, 5: PRINT "The text is about to be eaten" COLOR$ = "Y" 'Y - is completely random color 'N - is no color 'B - is bright. Bright colors only 'G - is the grey scale 'What to use COLOR$ in other screen modes: 'CGA - is the CGA color palette 'EGA - is the EGA color palette SPEWS = 100 'Number of dots to spew XS = SPEWS 'X location YS = SPEWS 'Y location DS = SPEWS 'Direction CS = SPEWS DIM X(XS) DIM Y(YS) DIM D(DS) DIM C(CS) XS = 1 YS = 1 DS = 1 CS = 1 FOR I = 1 TO SPEWS D(DS) = INT(RND * 9) + 1 X(XS) = 150 Y(YS) = 100 C(CS) = INT(RND * 256) + 1 IF MODE = 9 THEN X(XS) = 320 Y(YS) = 200 END IF IF MODE = 12 THEN X(XS) = 320 Y(YS) = 220 END IF IF UCASE$(COLOR$) = "EGA" THEN C(CS) = INT(RND * 15) + 1 IF UCASE$(COLOR$) = "CGA" THEN C(CS) = INT(RND * 4) + 1 IF UCASE$(COLOR$) = "G" THEN C(CS) = INT(RND * 30) + 1: IF C(CS) < 16 THEN C(CS) = 16 IF UCASE$(COLOR$) = "B" AND C(CS) > 165 THEN C(CS) = 165 IF UCASE$(COLOR$) = "N" THEN C(CS) = 15 DS = DS + 1 XS = XS + 1 YS = YS + 1 CS = CS + 1 NEXT I DS = 1 XS = 1 YS = 1 CS = 1 'Main loop DO PSET (X(XS), Y(YS)), 0 IF D(DS) = 1 THEN X(XS) = X(XS) - 1 IF D(DS) = 2 THEN Y(YS) = Y(YS) + 1: X(XS) = X(XS) + 1 IF D(DS) = 3 THEN X(XS) = X(XS) + 1 IF D(DS) = 4 THEN Y(YS) = Y(YS) - 1 IF D(DS) = 5 THEN Y(YS) = Y(YS) - 1: X(XS) = X(XS) - 1 IF D(DS) = 6 THEN Y(YS) = Y(YS) + 1: X(XS) = X(XS) - 1 IF D(DS) = 7 THEN Y(YS) = Y(YS) - 1: X(XS) = X(XS) + 1 IF D(DS) = 8 THEN Y(YS) = Y(YS) + 1 IF POINT(X(XS), Y(YS) + 1) <> 0 THEN GOSUB RERAND: PSET (X(XS), Y(YS)), C(CS) IF MODE = 1 OR MODE = 7 OR MODE = 13 THEN IF X(XS) < 1 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF Y(YS) > 200 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF X(XS) > 300 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF Y(YS) < 1 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: END IF IF MODE = 9 THEN IF X(XS) < 1 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF Y(YS) > 320 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF X(XS) > 640 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF Y(YS) < 1 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: END IF IF MODE = 12 THEN IF X(XS) < 1 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF Y(YS) > 470 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF X(XS) > 630 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: IF Y(YS) < 1 THEN PSET (X(XS), Y(YS)), 0: GOSUB RERAND: END IF '640x350 screen 9 DS = DS + 1 XS = XS + 1 YS = YS + 1 CS = CS + 1 'Here's something fun to do: '1 -> Set DS to zero - 100 '2 -> Set DS and XS to zero - four '3 -> Set DS and YS to zero - four IF DS > SPEWS THEN DS = 1 IF XS > SPEWS THEN XS = 1 IF YS > SPEWS THEN YS = 1 IF CS > SPEWS THEN CS = 1 LOOP UNTIL INKEY$ <> "" END RERAND: D(DS) = INT(RND * 9) + 1 RETURN