Sign in to follow this  

simple game

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

I am developing a game where a space ship shoots bricks at the top of the screen from the bottom of the screen. I have done alot of research on collision detection and bounding boxes in particular but I am still confused about how to implement a good collision detection routine.If you know of any really good web sites please share them with me.

Share this post


Link to post
Share on other sites
For collision detection for shooting bricks, you could just go with the [b]InsersectRect()[/b] function as the bullets would just travel straight up and always hit from below (I'm assuming). That should mostly suffice your needs depending on what you want to do. If it was a ball/brick collision like BreakOut, now that's a different story. [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img]

Share this post


Link to post
Share on other sites
You may experience the problem of your bullets travelling too fast, e.g. gone all the way past a brick without a collision in one time step. In that case intersecting a line with a rectangle might make more sense, e.g. the line from bullet_old_y to bullet_new_y.

Share this post


Link to post
Share on other sites
[quote name='jefferytitan' timestamp='1336627483' post='4938884']
You may experience the problem of your bullets travelling too fast, e.g. gone all the way past a brick without a collision in one time step. In that case intersecting a line with a rectangle might make more sense, e.g. the line from bullet_old_y to bullet_new_y.
[/quote]

Thank you jefferytitan. I forgot to mention that part. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites

This topic is 2043 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.

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