#### Archived

This topic is now archived and is closed to further replies.

# Direct X 8.0 (direct draw) collision

This topic is 5878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

how do you actually read the screen buffer in other to give your character a reference point of origin and when to know that it has collided with another object on the screen conceptually?

##### Share on other sites
Well, there is a lot of solutions for it ... here is mine :

To check 2 sprites intersection (A & B for example) :

1 - Check rectangles interesection (bounding rectangle)
A(Xmin1,Ymin1,Xmax1,Ymax1)
B(Xmin2,Ymin2,Xmax2,Ymax2)
If they interesect, go on step 2, else : no intersection

2 - Do a pixel/pixel check ... but not for the whole sprite size !!
Without a picture it''s a bit hard to explain ... imagine the area of the intersection (at a least a small square), so all you have to do is to compute the coordinates of this area and check the pixels inside ...

__________________________

Bruno Wieckowski
Exood4 Studios

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
18
5. 5

• 33
• 13
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
632566
• Total Posts
3007107

×