Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 Picturebox Collision Issue

$
0
0
I am making a simple game where a Rocket has to get to the top of the form by dodging meteors, i have one particular issue. Attachment 95651

You see, when the rocket clashes with the meteor, the game ends. But as you can see in the image, when these two pictureboxes clash in this way, the acutal rocket and meteor are no way near eactother, so even though the actual pictureboxes have clashed, the rocket and meteor hasn't.

Heres the code for the collision in case that needs to be changed:

If PictureBox1.Bounds.IntersectsWith(PictureBox2.Bounds) Or PictureBox1.Bounds.IntersectsWith(PictureBox3.Bounds) Or PictureBox1.Bounds.IntersectsWith(PictureBox4.Bounds) Then
Timer1.Stop()
MsgBox("You been hit! Unlucky!")
Dim response As Integer
response = MsgBox("Dare to go again?", vbYesNo)

There are three meteor pictureboxes btw (picbox 2,3,4) the rocket is picbox 1.

If you need any more information just ask. :)
Attached Images
 

Viewing all articles
Browse latest Browse all 42215

Trending Articles