// Yabasic 2.78.0, 5/2017
// Adapted by Galileo from this code: https://www.funprogramming.org/113-Array-of-objects-hypnotic-animation-part-II.html
caleiLength = 200
width = 400 : height = 400
x = 1 : y = 2 : t = 3 : speed = 4
dim calei(caleiLength,4)
open window width, height
backcolor 150,0,0
for i=0 to caleiLength
calei(i,x) = width/2 + cos(i/2) * i
calei(i,y) = height/2 + sin(i/2) * i
calei(i,speed) = 0.05 + i/1000
next i
do
pause .02
clear window
for i = 0 to caleiLength
switch int(mod(abs(sin(calei(i,t))),4)*4)
case 0: sz = 0 : break
case 1: sz = 1 : break
case 2: sz = 2 : break
case 3: sz = 4 : break
end switch
col = mod(calei(i,t),255)
color col,col,col
fill circle calei(i,x),calei(i,y),sz
calei(i,t) = calei(i,t)+calei(i,speed)
next i
loop