Snowflakes
#2
I admit it I'm impressed by your polygons, but i like my snowflakes  more branch-like

Code: (Select All)
'let it snow
'press any key to quit when running
Screen _NewImage(800, 500, 32)
Randomize Timer
Dim flakearm$(300)
Dim fx(300), fy(300), fv(300, 2), frot(300)

Color _RGB32(255, 255, 255), _RGB32(10, 10, 150)
'build flakes
For f = 1 To 300
    r1 = Int(Rnd * 12) + 4
    r2 = r1 / 4 + Int(Rnd * (r1 / 4))

    flakearm$(f) = " r" + Str$(r1) + "f" + Str$(r2) + "h" + Str$(r2) + "e" + Str$(r2) + "g" + Str$(r2) + "r" + Str$(r1 / 2)
    If Rnd * 6 > 3 Then flakearm$(f) = flakearm$(f) + "f" + Str$(r2) + "h" + Str$(r2) + "e" + Str$(r2) + "g" + Str$(r2)
    If Rnd * 6 > 4 Then flakearm$(f) = flakearm$(f) + "r3" + "f" + Str$(r2 / 2) + "h" + Str$(r2 / 2) + "e" + Str$(r2 / 2) + "g" + Str$(r2 / 2) + "r2"
    fx(f) = Int(Rnd * 800)
    fy(f) = Int(Rnd(50)) - 80
    fv(f, 1) = Rnd * (r1 / 16) - Rnd * (r1 / 16)
    fv(f, 2) = Rnd * (r1 / 4)
    frot(f) = Int(Rnd * 28)
Next f
'snow
Do
    _Limit 30
    Cls
    For f = 1 To 200
        For d = 0 + frot(f) To 360 + frot(f) Step 60
            PSet (fx(f), fy(f))
            Draw "ta" + Str$(d) + flakearm$(f)
        Next d
        fx(f) = fx(f) + fv(f, 1): fy(f) = fy(f) + fv(f, 2)
        If fy(f) > 550 Then fy(f) = -3 * (Rnd * 30)
        If fx(f) < -30 Or fx(f) > 830 Then
            fx(f) = Int(Rnd * 600) + 100
            fy(f) = -3 * (Rnd * 30)
            frot(f) = Int(Rnd * 28)
        End If
        If Rnd * 8 > 6.5 Then frot(f) = frot(f) + Rnd * 1.2 - Rnd * 2.4
    Next f
    _Display
    a$ = InKey$
Loop Until a$ <> ""
Reply


Messages In This Thread
Snowflakes - by SierraKen - 07-14-2022, 02:37 AM
RE: Snowflakes - by James D Jarvis - 07-14-2022, 01:47 PM
RE: Snowflakes - by bplus - 07-14-2022, 04:14 PM
RE: Snowflakes - by SierraKen - 07-14-2022, 05:38 PM
RE: Snowflakes - by SierraKen - 07-14-2022, 07:51 PM
RE: Snowflakes - by James D Jarvis - 07-15-2022, 11:54 AM
RE: Snowflakes - by SierraKen - 07-16-2022, 07:39 PM
RE: Snowflakes - by vinceg2022 - 07-19-2022, 06:14 AM
RE: Snowflakes - by James D Jarvis - 07-19-2022, 05:10 PM
RE: Snowflakes - by SierraKen - 07-19-2022, 11:34 PM



Users browsing this thread: 4 Guest(s)