Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a quite advanced top down car game and i use masks to detect collisions. I have the actual designed track (what the player see) with fancy graphics etc. and two other pictures i use as mask for my detection collisions. Each mask has only two colors, white and black and i check each frame if a pixel of the car collide with a black pixel of the masks.

This approach works of course but it's not really flexible. Whenever i want to change the look of a track, i have to redraw the mask and it's a real pain.

What is the general approach for this kind of game? How can i improve the flexibility of such a mask based approach?

share|improve this question
So you are using pixel-perfect collision detection instead of bounding boxes? – user8363 Sep 8 '12 at 14:40
@user8363 yeah, pixel perfect collision with masks. – nathan Sep 8 '12 at 15:21
Well, the general approach would be, I think, to use bounding boxes/polygons/triangles. – user8363 Sep 8 '12 at 15:57
@user8363 maybe for collision between cars (not done yet) but for complex track shape? i can't figure out how could i succesfully use polygons collisions between cars and the track. – nathan Sep 8 '12 at 16:27
I fail to understand what is so different between the collision between your cars and the track. Maybe you could clarify this? Is it a problem because your track might have curves you don't know how to deal with? – user8363 Sep 8 '12 at 23:14
show 1 more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.