10-13-2024, 07:02 AM
I took a moment to overhaul everything and reinsert a GoTo
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 + ...