12-10-2024, 08:11 PM
Thank You, NakedApe. Here is one small modification. Now it look something different...
Code: (Select All)
Screen _NewImage(1024, 768, 32)
Type Manim
As _Unsigned _Byte R, G, B, A, Radius, Sze
As Single Angle, Speed, SAngle
As _Unsigned Integer Cx, Cy
End Type
Dim Shared MoAn(5000) As Manim
Do Until _KeyDown(27)
Cls
DrawStars
_Display
_Limit 200
Loop
Sub DrawStars
Do Until i = UBound(MoAn)
J = MoAn(i).SAngle
While _MouseInput
Wend
MX = _MouseX
MY = _MouseY
CenterX = MX + Cos(MoAn(i).Angle) * MoAn(i).Radius
CenterY = MY + Sin(MoAn(i).Angle) * MoAn(i).Radius
If MoAn(i).A <= 0 Then
MoAn(i).Cx = CenterX: MoAn(i).Cy = CenterY
Else
PSet (MoAn(i).Cx, MoAn(i).Cy), _RGBA32(MoAn(i).R, MoAn(i).G, MoAn(i).B, MoAn(i).A)
End If
add = _Pi(2) / 6
Do Until J > MoAn(i).SAngle + _Pi(2)
Line -Step(Cos(J + MoAn(i).SAngle) * MoAn(i).Sze, Sin(J + MoAn(i).SAngle) * MoAn(i).Sze), _RGBA32(MoAn(i).R, MoAn(i).G, MoAn(i).B, MoAn(i).A)
J = J + add
Loop
If MoAn(i).Radius > _Pi(4) Or MoAn(i).A <= 10 Then
Randomize Timer
MoAn(i).R = 255 - 40 * Rnd
MoAn(i).G = 155 * Rnd
MoAn(i).B = 54 * Rnd
MoAn(i).A = 10 + 200 * Rnd
MoAn(i).Cx = CenterX: MoAn(i).Cy = CenterY
MoAn(i).Radius = 1 + Rnd
MoAn(i).Sze = 1
MoAn(i).Angle = _Pi(2) / 11 * i + MoAn(i).SAngle + 1
MoAn(i).Speed = (1 + Rnd * 110) / 300
MoAn(i).SAngle = 1
End If
MoAn(i).A = MoAn(i).A + .01
MoAn(i).Radius = MoAn(i).Radius + MoAn(i).Speed
MoAn(i).SAngle = MoAn(i).SAngle + _Pi / 10
MoAn(i).Sze = MoAn(i).Sze * .75
MoAn(i).A = MoAn(i).A - 2
MoAn(i).Angle = MoAn(i).Angle + .1
MoAn(i).Cx = MoAn(i).Cx + Cos(MoAn(i).Angle) * MoAn(i).Radius
MoAn(i).Cy = MoAn(i).Cy + Sin(MoAn(i).Angle) * MoAn(i).Radius
i = i + 1
Loop
End Sub