0 REM EXPLOSNS.BAS.txt

100 ' Initialize the DAZZLER
110 DZOP "I"
120 ' Explosion parameters
130 NUMDOTS = 200  ' Total number of dots in the explosion
140 MAXRADIUS = 50  ' Maximum explosion radius (half of 100-dot diameter)
150 ' Loop for multiple explosions
160 FOR EXPLOSION = 1 TO 10  ' Create 10 explosions with moving centers
170   ' Clear the DAZZLER display before each explosion
180   DZOP "Z"
190   ' Randomly set the center of the explosion within the 0-255 range
200   CX = INT(RND * (255 - 2 * MAXRADIUS)) + MAXRADIUS
210   CY = INT(RND * (255 - 2 * MAXRADIUS)) + MAXRADIUS
220   ' Loop to display dots in expanding radius layers
230   FOR RADIUS = 1 TO MAXRADIUS STEP 5  ' Gradually increase radius from 1 to
MAXRADIUS
240     ' Display a set of dots for the current radius
250     FOR I = 1 TO NUMDOTS / 10  ' Fewer dots at each radius
260       ' Random angle for each dot
270       ANGLE = RND * 6.28318  ' Random angle in radians (2 * PI)
290       ' Calculate X and Y position of the dot based on the expanding radius
300       X = CX + RADIUS * COS(ANGLE)
310       Y = CY + RADIUS * SIN(ANGLE)
320       ' Ensure X and Y are within 0-255 range
330       XPOS = INT(X)
340       YPOS = INT(Y)
350       IF XPOS < 0 THEN XPOS = 0
360       IF XPOS > 255 THEN XPOS = 255
370       IF YPOS < 0 THEN YPOS = 0
380       IF YPOS > 255 THEN YPOS = 255
390       ' Select a random color between 17 and 23
400       COLOR = 17 + INT(RND * 7)
410       ' Set the current color
420       DZOP "C", COLOR
430       ' Move cursor to calculated position and display dot
440       DZOP "P", XPOS, YPOS
450       DZOP "D"
460     NEXT I
470   NEXT RADIUS
480   ' Wait a short time between explosions
490   DZOP "W", 50
500 NEXT EXPLOSION
510 ' End the program
520 END