§ Исходный код


SCREEN 13

TYPE pt
  x AS SINGLE
  y AS SINGLE
  sx AS SINGLE
  sy AS SINGLE
  lt AS SINGLE
END TYPE

DIM fp(0 TO 320) AS pt

' Palette
FOR i = 1 TO 31
  OUT 968, i
  OUT 969, 2 * i
  OUT 969, 0
  OUT 969, 0
NEXT

FOR i = 0 TO 31
  OUT 968, 32 + i
  OUT 969, 63
  OUT 969, 2 * i
  OUT 969, 0
NEXT

DO

  nfree = 0

  ' Fade
  DEF SEG = &HA000
  FOR i = 0 TO 63999
    v% = PEEK(i) - 2
    IF v% < 0 THEN v% = 0
    POKE i, v%
  NEXT
  DEF SEG

  ' Processing
  FOR i = 0 TO 320

    IF fp(i).lt > 0 THEN

      PSET (fp(i).x, fp(i).y), INT(fp(i).lt)
      fp(i).x = fp(i).x + fp(i).sx
      fp(i).y = fp(i).y + fp(i).sy
      fp(i).sy = fp(i).sy + .01
      fp(i).sx = fp(i).sx * .995
      fp(i).lt = fp(i).lt - .25

    ELSE

      fp(i).lt = 0
      nfree = nfree + 1

    END IF

  NEXT

  ' Create new burst
  IF nfree > 160 THEN

    rx = RND * 320
    ry = RND * 100
    FOR i = 0 TO 320

      IF fp(i).lt = 0 THEN

        v = RND
        fp(i).x = rx
        fp(i).y = ry
        fp(i).sx = SIN(i / 320 * 6.28) * v
        fp(i).sy = COS(i / 320 * 6.28) * v
        fp(i).lt = 32 + RND * 31

      END IF
    NEXT

  END IF

LOOP WHILE INKEY$ = ""