How do I make the do while loop in my code work with z being a variable?
Function make(ByVal z As Object)
z.Location = zloc
z.Hide()
zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height))
If zloc.Y > 595 Then
zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height))
End If
z.location = zloc
Do While z.bounds.intersectswith(PictureBox1.Bounds, PictureBox2.Bounds, PictureBox3.Bounds)
zloc = New Point(RandomNumber(playspace.Width), RandomNumber(playspace.Height))
z.location = zloc
Loop
z.Location = zloc
z.Show()
Return (z)
End Function
The problem is I cant use the ".bounds.intersectswith" on a variable.