Variation of the previous one.
// Effect 10B
// Developed in Yabasic 2.78.0 by Galileo, 2/2017
// Play with parameters
// Taking advantage of code get from the eponymous program in SpecBAS
SCRw = 640 : SCRh = 480
sizeletter = 300 : t$ = "U"
OPEN WINDOW SCRw, SCRh
flakes=500
DEG = 0.0174532925
DIM a(flakes,2)
DIM w(flakes,2)
DIM p(flakes,7)
DIM s(SCRw, SCRh)
print "Please, wait ..."
FOR f=1 TO flakes
genera()
p(f,2)=-RAN(SCRh)
NEXT f
BACKCOLOR 0,0,0
clear window
color 1,0,0
text SCRw/2,SCRh/2,t$,"swiss"+str$(sizeletter),"cc"
for x = 0 to SCRw
for y = 0 to SCRh
cpixel$ = getbit$(x,y,x,y)
if cpixel$ = "rgb 1,1:010000" then
s(x, y) = 1
end if
next y
next x
COLOR 255,255,255
clear screen
do
FOR f=1 TO flakes
x = p(f,1) : y = p(f,2)
ink = p(f,6)
color ink,ink,ink
if (x > -1) and (y > -1) and (x < SCRw+1) and (y <= SCRh) and not(s(x,y)) then
eraseSF()
else
genera()
end if
p(f,2) = p(f,2) + p(f,3)
IF p(f,2)>SCRh genera()
a3=SIN(DEG * ((p(f,2)+p(f,5))/(w(f,2)/SCRh)))
p(f,1)=a3*a(f,1)*SIN(DEG * ((p(f,2)+p(f,5))/(w(f,1)/SCRw)))+p(f,4)
drawSF()
NEXT f
loop
REM New flake - call with f for the index
sub genera()
a(f,1)=(10+RAN(700))*(RAN(2)-1)
w(f,1)=3200+RAN(300)
a(f,2)=10+RAN(100)
w(f,2)=3200+RAN(300)
p(f,4)=RAN(SCRw+200)-100
p(f,2)=0
p(f,3)=.5+RAN(2)
p(f,1)=p(f,4)
p(f,5)=RAN(SCRh)
p(f,6)=RAN(16)+(255-16)
p(f,7)=INT(RAN(3))
end sub
sub eraseSF()
IF p(f,7)=1 THEN
clear DOT p(f,1),p(f,2)
ELSE
clear FILL CIRCLE p(f,1),p(f,2),p(f,7)
END IF
end sub
sub drawSF()
IF p(f,7)=1 THEN
DOT p(f,1),p(f,2)
ELSE
FILL CIRCLE p(f,1),p(f,2),p(f,7)
END IF
end sub