Here is a modification (mod) of B+'s "Basic Polygon and Multiplier Mod" of snowflakes falling down. He probably has made this before but I thought I would try it myself.
Thanks B+!
Code: (Select All)
'Snowflakes - mod from B+'s Basic Polygon and Multiplier Mod
'b+ 2022-07-13, SierraKen 2022-07-13
_Title "Snowflakes" 'b+ 2022-07-13, SierraKen 2022-07-13
Dim xc(500), yc(500), r(500), n(500), x(500), y(500)
' a circle is 360 degree
' a polyon of n side has central angles 360 / n > think of a pie the central angle are the angle of slices in center
Screen _NewImage(800, 600, 32)
_ScreenMove 350, 100
Randomize Timer
Do
_Limit 30
If Rnd > .25 Then
t = t + 1
If t > 495 Then t = 0
xc(t) = Rnd * _Width
yc(t) = 1
r(t) = Rnd * 20
n(t) = Int(Rnd * 10) + 3
End If
For tt = 1 To t
yc(tt) = yc(tt) + 1
For m = 1 To n(tt) - 1
For angle = 0 To 720 Step 360 / n(tt) ' step the size of pie angles
' let xC, yC be the coordinates at the center of the pie circle
' let r be the radius of the pie
' then the n outside points are
x(tt) = xc(tt) + r(tt) * Cos(m * _D2R(angle) - _Pi / 2) ' x coordinate of outter edge point
y(tt) = yc(tt) + r(tt) * Sin(m * _D2R(angle) - _Pi / 2) ' y coordinate of outter edge point
If angle = 0 Then PSet (x(tt), y(tt)) Else Line -(x(tt), y(tt)) ' outter edge edge
Line (xc(tt), yc(tt))-(x(tt), y(tt)) ' slice from center of pie
Next
Next m
Next tt
_Display
Cls
Loop Until InKey$ = Chr$(27)