collision

Started by
2 comments, last by bintangku 23 years, 4 months ago
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....
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^_^)
i''ll try your method first....it''s seems quite interesting...and i''ll compare with other method also.. thanx
after all i tried..i realized that I can''t the code with my own expertise...can someone help me with some code...

This topic is closed to new replies.

Advertisement