§ Исходники


SCREEN 13

' Set palette grayscale
FOR i = 0 TO 63: OUT 968, i: OUT 969, i: OUT 969, i: OUT 969, i: NEXT

' Starfeld
FOR i = 1 TO 256: PSET (RND * 320, RND * 100), RND * 31: NEXT i

LOCATE 2, 31: COLOR 47: PRINT "MoonLight"

' Moon
rx = 50: ry = 60

CIRCLE (rx, ry), 15, 31, , , 1
PAINT (rx, ry), 25, 31
FOR i = 0 TO 3.14 STEP .01: PSET (rx + 8 * SIN(i), ry + 15 * COS(i)), 31: NEXT
PAINT (rx + 12, ry), 53, 31

FOR y = -30 TO 30
FOR x = -30 TO 30
  r = x ^ 2 + y ^ 2
  IF r > 15 ^ 2 THEN
    d = 45 - SQR(r) * 1.4
    d = d + POINT(rx + x, ry + y)
    IF d < 0 THEN d = 0
    IF d > 63 THEN d = 63
    PSET (rx + x, ry + y), d
  END IF
NEXT
NEXT


CONST p = 100
CONST h = 5

DO

  FOR y = -100 TO -1
  FOR x = -160 TO 160

    zn = p * h / y
    xn = x * h / y

    ' Waves
    dx = SIN(xn) * COS(t + zn)
    dx = dx + SIN(2 * xn - t) * COS(3 * zn + t) / 2
    dx = dx + SIN(3 * xn + t) * COS(.5 * zn - t)
    dx = dx + SIN(.5 * xn + t) * COS(1.5 * zn + t)
    dx = dx * 4

    ' For fun only
    dy = COS(xn) * SIN(zn) * 4

    ' Reflection distort
    nx = x + 160 + dx
    ny = y + 100 + dy

    r = POINT(nx, ny)
    r = r * .75 + 4 + dx
    r = 4 * r / SQR(ABS(zn))

    IF nx < 0 OR nx > 319 OR ny < 0 AND ny > 100 THEN r = 0
    IF r > 63 THEN r = 63
    IF r < 0 THEN r = 0

    PSET (160 + x, 100 - y), r AND 63

  NEXT
  NEXT

  t = t + .1

LOOP WHILE INKEY$ = ""