Jump to content
  • Advertisement

Archived

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

bintangku

collision

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

i''ve try one method of collision detection by using image size...the problem is I want to create a fighting style that require an accurate collision detection..so how do I gonna create the detection using DX ColorKey..is it can be apply with DirectX''s ColorKey or not..whether yes or no please provide some technique please....

Share this post


Link to post
Share on other sites
Advertisement
If I know what you''re talking about, I was planning to use about the same technique on my game^^
The way I had planned was to have a layer of black/white tiles, the first of which is pure black (so I don''t have to check every pixel if there''s no obstruction data on the tile). Then when you move, it checks every tile you''re currently on top of, and if it''s tile 0 (that first blank one) let you move, if it''s not 0, go check each pixel. I couldn''t get it to work quite right though, and decided using a collision polygon would be faster (though I couldn''t have like a pixel on one side, then a pixel on the other (not that I''d ever need something like that anyway^)). Haven''t actually done it yet though.

Oh, and with the colorkey thing, I think it''d be fastest to just have one colorkey value for all of your images, so you could just go through checking the pixels for that value instead of getting the colorkey for the surface first.
Or my plan was to have an extra surface for the obs data, so I could do something like have a character with the bottom half an obstruction and the top half not, so they could get up closer to things. Takes more memory that way, but it''s more flexible too. I just made my own 1-bit surface class to conserve memory. If you want, I could post it since it''s not very big.



-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!