|
-
Dec 8th, 2001, 05:55 PM
#1
Thread Starter
Addicted Member
2D Collision Detection, HELP!
Hi, can anyone help me? How can I do 2d collision detection when I only have the x and y coords of my objects.
Thanks.
-
Dec 8th, 2001, 05:59 PM
#2
Good Ol' Platypus
To do rectangular collision, you'd need to have the height and width of the objects too.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Dec 11th, 2001, 05:24 PM
#3
Addicted Member
Well...
You could also hard-code the size of your objects, and use the X and Y as a centerpoint.
VB Code:
Const ObjectSize = 32
Dim ObjectRect as RECT, ObjectX as Long, ObjectY as Long
ObjectRect.Left = ObjectX - (ObjectSize \ 2)
ObjectRect.Right = ObjectX + (ObjectSize \ 2)
ObjectRect.Top = ObjectY - (ObjectSize \ 2)
ObjectRect.Bottom = ObjectY + (ObjectSize \ 2)
Hope this helps...
"1 4m 4 1337 #4xz0r!'
Janus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|