Jump to content
  • Advertisement
Sign in to follow this  

Breakout collision detection issue

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

For my collision detection in my Breakout clone game I first check each block for a collision with the ball. If there is a collision I then check each individual wall of the block to determine which way for the ball to bounce back. My first question is if this is the right way to handle this? If so, that leads me to my second question. If the ball has only collided with a single wall of the block this works fine but if it happens to come at an angle across the corner or something similar it will overlap with two walls at the same time. The way I have my code set up whichever wall I test first is the one that it will bounce off. Sometimes this creates very strange results. Should I be checking for which wall the ball overlaps with the most instead? I can't really think of how to approach that.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!