Archived

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

Guest Anonymous Poster

collision detection in 2d

Recommended Posts

Ok, first, I've never done this before, but I think you have to store somewere the places your car can be or not; one possible way (and probably the easiest) would be to have a bitmap with white (or black) representing where the car can be, so to know whether you could (or couln't) move the care to a x,y position you would just check if that pixel was white. Of course, there are allways other ways, although less practical, like the defining the edges of the track line segments and checking wether the car would be to the left/right of that line segment (only one side would be valid) This would mean a lot of calculation, defining wich segment you would refer to, etc.

hope that helped

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I want to make a top-view race game .
My background shows the landscape and the track.
Now I need to tell the computer where the car can go to and where not.
In some commercial games i've seen a second background just painted black and white(the track). Is this the way it has to be done ?
And how?

please try to help me !

Share this post


Link to post
Share on other sites