The flies' positions are goverened by this:
VB Code:
For i = 0 To UBound(pixels) - 1
With pixels(i)
''
'' some code
''
If distanceBetweenTwoPoints(pos, .pos) < 25 Then
Do Until (distanceBetweenTwoPoints(pos, .pos) > 35)
With .pos
.x = .x + (2 * Rnd)
.Y = .Y + (2 * Rnd)
End With
Loop
End If
''
'' some code
''
Next
''
'' elsewhere
''
Private Function distanceBetweenTwoPoints(ByRef point1 As pointapi, ByRef point2 As pointapi) As Single
distanceBetweenTwoPoints = (((point2.x - point1.x) ^ 2) + ((point2.Y - point1.Y) ^ 2)) ^ 0.5
End Function