Page 1 of 1
One picture box can not collide or go through another
Posted: Thu Jul 01, 2010 3:26 am
by zachman61
im making a game and i need help with one thing which is how can i keep one picture box from going into and out of another ex: when one picture box strikes another it stops and can not go the same way
Re: One picture box can not collide or go through another
Posted: Thu Jul 01, 2010 4:12 am
by NoWayIn
You could use If picturebox1.Intersectwith(picturebox2.left) or something like that
You could also look up "Collision Detection"
I made one a really long time ago but I don't have the source anymore =\
I was trying to make a game too xD
it worked out okay, lots of bugs though
Re: One picture box can not collide or go through another
Posted: Thu Jul 01, 2010 7:48 pm
by mandai
IntersectsWith takes a Rectangle as the argument, so it would be picturebox2.Bounds that you would want to check for.
I think this has already been partially answered here
viewtopic.php?f=32&t=1894&p=11663
You should make the thread that moves your picturebox check to see that it is not intersecting with your other controls.