Jump to content
  • Advertisement
Sign in to follow this  
Ronin28

Colision Help

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

Hello all, I am creating a pacman clone. Does any one have any suggestions for setting up colision detection between the character object and the walls. The maze is all one image. I am using visual studio 2003 (c++) and HGE. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If it's in 2D, just use bounding boxes. Even if the graphics are 3D, I would imagine for any pacman clone the gameplay is in 2D.

Just ignore the vertical component of your coordinate system and see if the boundaries of Pacman overlap with the walls.

Edit: Sorry, I somehow missed the second sentence last time around. If it were me I would convert the image into wall coordinates.

Share this post


Link to post
Share on other sites
try calculating the rectangle around the characters using their coordiantes and dimensions. after that a call to IntersectRect's wil tell you if they collide (it returns true if so).

Share this post


Link to post
Share on other sites
Thanks for the help. I will be breaking the image up into a set of tiles within the program and the use collision detection accordingly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!