Posts: 409
Threads: 47
Joined: Nov 2023
Reputation:
3
Cast your minds back to early Windows days (Win95) and the almost hypnotic Mystify screen saver....
Messing around with a Javascript tutorial to recreate Mystify and figured I might see if N7 could do the same.
I have included the HTML and Javascript files (for comparison) as well as my version for N7...
Feel free to tinker....
J
mystify.zip (Size: 1.59 KB / Downloads: 7)
Logic is the beginning of wisdom.
Posts: 405
Threads: 53
Joined: Nov 2023
Reputation:
3
(03-07-2025, 01:30 PM)johnno56 Wrote: Cast your minds back to early Windows days (Win95) and the almost hypnotic Mystify screen saver....
Messing around with a Javascript tutorial to recreate Mystify and figured I might see if N7 could do the same.
I have included the HTML and Javascript files (for comparison) as well as my version for N7...
Feel free to tinker....
J
Excellent!
Now, of course, I've got to pull off a 3d text screen saver.
Posts: 409
Threads: 47
Joined: Nov 2023
Reputation:
3
(03-07-2025, 03:09 PM)Marcus Wrote: Excellent!
Now, of course, I've got to pull off a 3d text screen saver.
You realize that, since we have gone "flat screen", the use of "screen savers" are pretty much pointless, right? lol
3D you say? Do you mean something like this?
Logic is the beginning of wisdom.
Posts: 405
Threads: 53
Joined: Nov 2023
Reputation:
3
(03-07-2025, 06:22 PM)johnno56 Wrote: (03-07-2025, 03:09 PM)Marcus Wrote: Excellent!
Now, of course, I've got to pull off a 3d text screen saver.
You realize that, since we have gone "flat screen", the use of "screen savers" are pretty much pointless, right? lol
3D you say? Do you mean something like this?
Ooh, that one I remember, was fun to watch!
I've wrote a 3d text "screen saver" this morning but need to pimp it up a bit before I post it
Posts: 275
Threads: 35
Joined: Nov 2023
Reputation:
0
Just another version of Mystify.... not as good as the real one
Code: ' Mystify
set window "mystify", 800, 600,false
set redraw off
numPolys = 2 ' Number of polygons
pointsPerPoly = 4 ' Points per polygon (3=triangle, 4=quad)
trailLength = 10 ' Number of trailing positions to show
trailGap = 3 ' Space between trail segments
' Initialize arrays
x=dim(numPolys * pointsPerPoly, trailLength)
y=dim(numPolys * pointsPerPoly, trailLength)
dx=dim(numPolys * pointsPerPoly)
dy=dim(numPolys * pointsPerPoly)
' Set up initial positions and velocities
for poly1 = 0 to numPolys-1
for i = 0 to pointsPerPoly-1
index = poly1*pointsPerPoly + i
x[index][0] = rnd(800)
y[index][0] = rnd(600)
for t = 1 to trailLength-1
x[index][t] = x[index][0]
y[index][t] = y[index][0]
next
do
dx[index] = (rnd(6))-3 ' Random velocity
dy[index] = (rnd(6))-3
until dx[index] <> 0 and dy[index] <> 0
next
next
'-----------
' MAIN LOOP
'-----------
while not keydown(KEY_ESCAPE,true)
set color 0,0,0
cls
for poly1 = 0 to numPolys-1
polyStart = poly1*pointsPerPoly
'color
if poly1=0 then set color 255,255,0
if poly1=1 then set color 255,0,0
' Update positions and shift trail history
for i = 0 to pointsPerPoly-1
index = polyStart + i
' Update current position
x[index][0] = x[index][0]+dx[index]
y[index][0] = y[index][0]+dy[index]
' Collision detection
if x[index][0] < 0 or x[index][0] > 800 then dx[index] = -dx[index]
if y[index][0] < 0 or y[index][0] > 600 then dy[index] = -dy[index]
' Shift history buffer
for t = trailLength-1 to 1 step -1
x[index][t] = x[index][t-1]+trailGap
y[index][t] = y[index][t-1]+trailGap
next
next
' Draw all trail segments with solid color
for t = 0 to trailLength-1
for i = 0 to pointsPerPoly-1
index = polyStart + i
nextIndex = polyStart + (i+1) % pointsPerPoly
draw line x[index][t], y[index][t], x[nextIndex][t], y[nextIndex][t]
next
next
next
fwait 60
redraw
wend
Posts: 409
Threads: 47
Joined: Nov 2023
Reputation:
3
I haven't seen 'this' version in a very long time... The 'real' one and this version were circulating about the same time... But, it's still a cool version... Thanks for the memories...
Logic is the beginning of wisdom.
Posts: 275
Threads: 35
Joined: Nov 2023
Reputation:
0
How about "Pipes 2D" ?
Code: ' Set up the screen
#win32
set window "Pipes 2D", 640, 480,false
'randomize
randomize time()
'color definition
black = [0,0,0]
white = [255,255,255]
red = [255,0,0]
green = [0,255,0]
blue = [0,0,255]
yellow = [255,255,0]
cyan = [0,255,255]
magenta = [255,0,255]
' Define colors for the pipes
colors=[]
colors[0] = red
colors[1] = green
colors[2] = blue
colors[3] = yellow
colors[4] = cyan
colors[5] = magenta
'initial color
col = red
' Pipe settings
pipe_width = 10
speed = pipe_width
' Directions: 0 = right, 1 = down, 2 = left, 3 = up
direction = int(rnd() * 4)
' Starting position
x = width()/2
y = height()/2
' Main loop
while not keydown(KEY_ESCAPE)
' Randomly choose a color for the new pipe segment
set color col
' Draw the pipe segment based on direction
if direction = 0 then
' Right
draw rect x, y, pipe_width, pipe_width,true
x = x + speed
elseif direction = 1 then
' Down
draw rect x, y, pipe_width, pipe_width,true
y = y + speed
elseif direction = 2 then
' Left
draw rect x, y, pipe_width, pipe_width,true
x = x - speed
elseif direction = 3 then
' Up
draw rect x, y, pipe_width, pipe_width,true
y = y - speed
endif
' Change direction randomly or when hitting the screen edge
if x <= (0+pipe_width) or x >= (640 - pipe_width) or
y <= (0+pipe_width) or y >= (480 - pipe_width) or
int(rnd() * 20) < 10 then
direction = int(rnd() * 4)
endif
' Clear the screen occasionally to prevent clutter
if int(rnd() * 1800) < 5 or keydown(KEY_SPACE,true) then
set color black
cls
x = width()/2
y = height()/2
endif
'change colors
if int(rnd() * 400) < 5 then
col = colors[int(rnd() * 5)]
x = x + pipe_width*2
y = y + pipe_width*2
endif
' Pause for a short time
fwait 60
wend
Posts: 405
Threads: 53
Joined: Nov 2023
Reputation:
3
Love both the mystifies! And pipes 2d was actually quite funny  I'll see if I can write a pipes 3d when i get the time.
|