This is all from memory, I tried to look up Mystic Screen saver and got nowhere... so I might have the name wrong.
SmallBASIC version:
' Mystic memories.bas SmallBASIC 0.12.9 (B+=MGA) 2017-09-29
' I modified from my posted 2017-09-29 for QB64
' Mystic screen saver as I remember it plus...
option predef antialias off 'runs faster (or smoother) might improve image
randomize timer
dim x(2), y(2), dx(2), dy(2)
for i = 0 to 2
newPoint i
next
saveX = x : saveY = y : saveDX = dx : saveDY = dy
dmode = 1 : nT = 50
resetPlasma
while 1
cls
color 11
? " Number of triangles = ";nT;" press m for more, l for less,"
? " spacebar to change color, d for duplicate image toggle."
cN = cN - nT + 1
x = saveX : y = saveY : dx = saveDX : dy = saveDY
for i = 0 to 2
updatePoint i
next
saveX = x : saveY = y : saveDX = dx : saveDY = dy
for j = 1 to nT
for i = 0 to 2
updatePoint i
next
changePlasma
for i = 0 to 2
line x(i), y(i), x((i+1) mod 3), y((i+1) mod 3)
next
if dmode = 1 then
for i = 0 to 2
line xmax - x(i), ymax - y(i), xmax - x((i+1) mod 3), ymax - y((i+1) mod 3)
next
end if
next
showpage
delay 10
k = inkey
if k = " " then
resetPlasma
elif k = "d"
dmode = not dmode
elif k = "m"
nT = nT + 1: if nT > 100 then nT = 100
elif k = "l"
nT = nT - 1: if nT < 1 then nT = 1
fi
wend
sub newPoint(p)
x(p) = RND * xmax
y(p) = RND * ymax
dx(p) = (RND * 10 + 1) * rdir
dy(p) = (RND * 6 + 1) * rdir
end
sub updatePoint(p)
if x(p) + dx(p) < 0 then dx(p) = -dx(p)
if y(p) + dy(p) < 40 then dy(p) = -dy(p)
if x(p) + dx(p) > xmax then dx(p) = -dx(p)
if y(p) + dy(p) > ymax - 40 then dy(p) = -dy(p)
x(p) = x(p) + dx(p)
y(p) = y(p) + dy(p)
end
sub changePlasma ()
cN = cN + 1
color rgb(127 + 127 * sin(pR * .2 * cN), 127 + 127 * sin(pG * .2 * cN), 127 + 127 * sin(pB * .2 * cN))
end
sub resetPlasma ()
pR = rnd ^ 2: pG = rnd ^ 2: pB = rnd ^ 2
end
func rdir()
IF rnd < .5 THEN rdir = -1 ELSE rdir = 1
end
QB64 version (which you might see, no great difference in PL):
_TITLE "Mystic Memories by bplus, d toggles duplicate on/off, spacebar resets color, m = more, l = less triangles"
'posted 2017-09-29 for QB64, Mystic screen saver as I remember it plus...
RANDOMIZE TIMER
CONST xmax = 1100
CONST ymax = 700
TYPE point
x AS INTEGER
y AS INTEGER
dx AS SINGLE
dy AS SINGLE
END TYPE
COMMON SHARED pR, pG, pB, cN
SCREEN _NEWIMAGE(xmax, ymax, 32)
_SCREENMOVE (_DESKTOPWIDTH - xmax) / 2, (_DESKTOPHEIGHT - ymax) / 2 '_MIDDLE does not work?
DIM tri(2) AS point
FOR i = 0 TO 2
newPoint tri(i)
NEXT
DIM saveP1 AS point
DIM saveP2 AS point
DIM saveP3 AS point
saveP1 = tri(0): saveP2 = tri(1): saveP3 = tri(2)
dmode = 0: nT = 50
resetPlasma
WHILE 1
CLS , 0
cN = cN - nT
tri(0) = saveP1: tri(1) = saveP2: tri(2) = saveP3
FOR i = 0 TO 2
updatePoint tri(i)
NEXT
saveP1 = tri(0): saveP2 = tri(1): saveP3 = tri(2)
FOR j = 1 TO nT
FOR i = 0 TO 2
updatePoint tri(i)
NEXT
changePlasma
FOR i = 0 TO 2
LINE (tri(i).x, tri(i).y)-(tri((i + 1) MOD 3).x, tri((i + 1) MOD 3).y)
NEXT
IF dmode THEN
FOR i = 0 TO 2
LINE (xmax - tri(i).x, ymax - tri(i).y)-(xmax - tri((i + 1) MOD 3).x, ymax - tri((i + 1) MOD 3).y)
NEXT
END IF
NEXT
_DISPLAY
k$ = INKEY$
IF k$ = " " THEN
resetPlasma
ELSEIF k$ = "d" THEN
dmode = NOT dmode
ELSEIF k$ = "m" THEN
nT = nT + 1: IF nT > 500 THEN nT = 500
ELSEIF k$ = "l" THEN
nT = nT - 1: IF nT < 1 THEN nT = 1
END IF
_LIMIT 10
WEND
SUB newPoint (p AS point)
p.x = RND * xmax
p.y = RND * ymax
p.dx = (RND * 10 + 1) * rdir
p.dy = (RND * 6 + 1) * rdir
END SUB
SUB updatePoint (p AS point)
IF p.x + p.dx < 0 THEN p.dx = p.dx * -1
IF p.y + p.dy < 0 THEN p.dy = p.dy * -1
IF p.x + p.dx > xmax THEN p.dx = p.dx * -1
IF p.y + p.dy > ymax THEN p.dy = p.dy * -1
p.x = p.x + p.dx
p.y = p.y + p.dy
END SUB
SUB changePlasma ()
cN = cN + 1
COLOR _RGB(127 + 127 * SIN(pR * .1 * cN), 127 + 127 * SIN(pG * .1 * cN), 127 + 127 * SIN(pB * .1 * cN))
END SUB
SUB resetPlasma ()
pR = RND ^ 2: pG = RND ^ 2: pB = RND ^ 2
END SUB
FUNCTION rdir% ()
IF RND < .5 THEN rdir% = -1 ELSE rdir% = 1
END FUNCTION
Maybe you guys have a favorite cloned from the past?