Archived

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

Junghans

Collision detection

Recommended Posts

Well pixel perfect collision detection is fairly simple. In this instance let''s say we have a 32x32 tile, and a 64x64 character. Now because testing each pixel for a collision is extremly slow especialy when done on a large scale you should first do a bounding box test. If my 64x64 character has hit the location of the 32x32 tile, then it''s time for us to check the pixels. Now in this instance both our 32x32 tile & 64x64 tile use RGB 0,0,0 for the transparent color. So now we test each pixel in our 32x32 tile & 64x64 tile until the RGB color isn''t 0,0,0. Once this happens you have a collision.

Share this post


Link to post
Share on other sites