试图无限引用方形图片框碰撞

时间:2018-05-22 15:50:16

标签: vb.net visual-studio

我正试图让它同时检测来自我成千上万个图片盒的碰撞。我似乎无法使它工作,我只是得到150计时器滴答延迟,然后无限冲突 BikeB移动每个计时器滴答xb,yb是Bikeb上的位置。我基本上是在创建一条线。

Dim lineb As New PictureBox
    lineb.Size = New Size(24, 24)
    lineb.BackColor = Color.FromArgb(192, 0, 0)
    lineb.Location = New Drawing.Point(xb, yb)
    lineb.Tag = creatorb
    Controls.Add(liner)
    liner.Name = "liner" + CStr(creatorb)
    creatorb -= 1 

For Each Ctrl As Control In Me.Controls
        If TypeOf Ctrl Is PictureBox Then
            If Ctrl.Name <> "BikeB" Then
                If Ctrl.Tag < creatorb - 150 Then
                    If BikeB.Bounds.IntersectsWith(Ctrl.Bounds) Then
                        MsgBox("Blue Loses")
                        BikeMove.Enabled = False
                    End If
                End If
            End If
        End If
Next

0 个答案:

没有答案