- Код: Выделить всё
Private Type Point_s
X As Single
Y As Single
cX As Single
cY As Single
End Type
Private Type Volna_T
Circle_s(64) As Point_s
X_c As Integer
Y_c As Integer
H As Single
Visuble As Boolean
End Type
Dim Run As Boolean
Private Const Pi As Single = 3.14159265358979
Dim M_Volna(50) As Volna_T
Dim X_m As Integer
Dim Y_m As Integer
Dim FPS As Long
Private Sub Render_C(Volna As Volna_T)
Dim Old_C As Point_s
If Volna.Visuble = False Then Exit Sub
Old_C = Volna.Circle_s(0)
Volna.H = Volna.H - 0.5
If Volna.H < 0 Then Volna.Visuble = False: Exit Sub
For i& = 1& To UBound(Volna.Circle_s)
Me.Line (Old_C.X, Old_C.Y)-(Volna.Circle_s(i).X, Volna.Circle_s(i).Y), RGB(Volna.H, Volna.H, Volna.H)
Old_C = Volna.Circle_s(i)
Next i&
End Sub
Private Sub Init_C(Volna As Volna_T, R As Single)
For i& = 0 To UBound(Volna.Circle_s)
Volna.Circle_s(i).X = Volna.X_c + R * Cos(Pi * (i / (UBound(Volna.Circle_s) / 2)))
Volna.Circle_s(i).Y = Volna.Y_c + R * Sin(Pi * (i / (UBound(Volna.Circle_s) / 2)))
Volna.Circle_s(i).cX = 0.2
Volna.Circle_s(i).cY = 0.2
Next i&
Volna.Visuble = True
Volna.H = 255&
End Sub
Private Sub Phisic_C(Volna As Volna_T)
If Volna.Visuble = False Then Exit Sub
For i& = 0& To UBound(Volna.Circle_s)
If Volna.Circle_s(i).X <= 0 Or Volna.Circle_s(i).X >= Me.ScaleWidth Then Volna.Circle_s(i).cX = -Volna.Circle_s(i).cX
If Volna.Circle_s(i).Y <= 0 Or Volna.Circle_s(i).Y >= Me.ScaleHeight Then Volna.Circle_s(i).cY = -Volna.Circle_s(i).cY
Volna.Circle_s(i).X = Volna.Circle_s(i).X + Volna.Circle_s(i).cX * Cos(3.14 * (i / (UBound(Volna.Circle_s) / 2)))
Volna.Circle_s(i).Y = Volna.Circle_s(i).Y + Volna.Circle_s(i).cY * Sin(3.14 * (i / (UBound(Volna.Circle_s) / 2)))
Next i&
End Sub
Private Sub Form_Click()
Dim flag As Integer
flag = 1&
For i& = 0& To UBound(M_Volna)
If M_Volna(i&).Visuble = False Then
M_Volna(i&).X_c = X_m
M_Volna(i&).Y_c = Y_m
Init_C M_Volna(i&), 15& / (flag / 2&)
Render_C M_Volna(i&)
flag = flag + 1&
End If
If flag >= 5& Then Exit Sub
Next i&
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then Run = False
End Sub
Private Sub Form_Load()
Me.BackColor = 0
Me.AutoRedraw = True
Me.Width = 9690
Me.Height = 7680
Me.Show
Run = True
While Run = True
DoEvents
Me.Cls
For i& = 0& To 50&
Phisic_C M_Volna(i&)
Render_C M_Volna(i&)
Next i&
Wend
End
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
X_m = X
Y_m = Y
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Вопрос: Как сделать такой бамр?