PDA

Click to See Complete Forum and Search --> : How can I do collision detection in vb? Please read...please.


Apollo
Nov 12th, 1999, 06:13 AM
I'm making a 2D game in vb, and I need rectangular collision detection.

Or, what I need is to make sure my character can't step on certain areas of the form, to be less complex sounding.

If anyone can give me one way to do this, I will be forever grateful.

Thanks in advance!

------------------
"I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

SteveCRM
Nov 12th, 1999, 07:09 AM
I use this: If Abs(Image1.Left - Image2.Left) < Image1.Width And Abs(Image1.Top - Image2.Top) < Image1.Height Then ...and put whatever you want after Then. Hope it helps


Steve

Ron
Nov 12th, 1999, 10:07 AM
You can check to see if two bitmaps intersect using the IntersectRect API call.