Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smooothness
#7
I took a moment to overhaul everything and reinsert a GoTo Big Grin
Code: (Select All)
Option _Explicit
_Title "Another Particle Fountain" ' bplus mod Steve mod NakedApe  2024-10-13
Screen _NewImage(600, 600, 32)
_ScreenMove 250, 20
Randomize Timer: _MouseHide
_Delay .25: _ScreenMove _Middle

Type particle
    As Single x, y, Vx, Vy
    As _Unsigned Long c
    As Integer flag
End Type
Dim As Long i, top, j, s
Dim As Single r, g, b
restart:
ReDim As particle p(15000)
r = Rnd * Rnd: g = Rnd * Rnd: b = Rnd * Rnd: top = 1
Do
    Cls
    For i = 0 To top
        If p(i).flag = 0 Then
            p(i).x = _Width / 2 + 20 * (Sin(_D2R(i Mod 360)))
            p(i).y = _Height - 1
            p(i).Vx = 0
            p(i).Vy = -7
            p(i).flag = 1
            p(i).c = _RGB32(127 * 127 * Sin(r * i * .5), 127 * 127 * Sin(g * i * .5), 127 * 127 * Sin(b * i * .5))
        End If
        p(i).Vy = p(i).Vy + .032
        p(i).Vx = p(i).Vx + .1 * Rnd - .1 * Rnd
        p(i).x = p(i).x + p(i).Vx
        p(i).y = p(i).y + p(i).Vy + 2 * Rnd
        If p(i).y > _Height Then p(i).flag = 0
        Circle (p(i).x, p(i).y), 2, p(i).c
        s = s + 1
        If s Mod 100 = 0 Then
            If top < UBound(p) Then top = top + 1
        End If
    Next
    _Display
    _Limit 60
    If s > 20000000 Then
        s = 0
        GoTo restart
    End If
Loop Until _KeyDown(27)
System
b = b + ...
Reply


Messages In This Thread
Smooothness - by NakedApe - 10-10-2024, 10:31 PM
RE: Smooothness - by bplus - 10-10-2024, 10:38 PM
RE: Smooothness - by NakedApe - 10-11-2024, 01:22 AM
RE: Smooothness - by SMcNeill - 10-11-2024, 01:54 AM
RE: Smooothness - by NakedApe - 10-11-2024, 05:26 AM
RE: Smooothness - by DSMan195276 - 10-11-2024, 05:29 AM
RE: Smooothness - by NakedApe - 10-13-2024, 03:57 PM
RE: Smooothness - by SMcNeill - 10-13-2024, 05:42 PM
RE: Smooothness - by bplus - 10-13-2024, 07:02 AM
RE: Smooothness - by NakedApe - 10-13-2024, 07:37 PM



Users browsing this thread: 1 Guest(s)