Sign in to follow this  

collsion detection

Recommended Posts

Original post by phil67rpg
well it is between a paddle and ball for a breakout game, I am using c++ and open gl

my old project done 4 years ago, in C/OpenGL (not perfect but should enough)

Share this post

Link to post
Share on other sites
You should be able to do simple bounding box detection.

Do a few google searches for bounding box and to be more specific "axis aligned bounding boxes".

The general idea is you keep track of the 4 corners of each rectangle then if you want to check for a collision you just see if the extents of one rectangle are in the boundaries of a second rectangle. If they are then you have a collision.

It can be done with simple math and is very easy to do.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this