Jump to content
  • Advertisement

Archived

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

Guest Anonymous Poster

collision detection in 2d

This topic is 6778 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

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
Advertisement
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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!