• Create Account

## simple game

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1phil67rpg  Members

213
Like
0Likes
Like

Posted 08 May 2012 - 08:59 PM

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.

### #2Marvel Magnum  Members

333
Like
0Likes
Like

Posted 08 May 2012 - 10:50 PM

For collision detection for shooting bricks, you could just go with the InsersectRect() 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.

### #3phil67rpg  Members

213
Like
0Likes
Like

Posted 09 May 2012 - 05:44 PM

actually it is like breakout,but I will try IntersectRect() method.

### #4jefferytitan  Members

2508
Like
2Likes
Like

Posted 09 May 2012 - 11:24 PM

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.

### #5Marvel Magnum  Members

333
Like
0Likes
Like

Posted 10 May 2012 - 01:17 AM

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.

Thank you jefferytitan. I forgot to mention that part.

### #6phil67rpg  Members

213
Like
0Likes
Like

Posted 10 May 2012 - 02:07 PM

thanks for all the help,

### #7phil67rpg  Members

213
Like
0Likes
Like

Posted 13 May 2012 - 11:35 PM

I am currently working on a breakout/space invaders cross.I am using dx9 and c++.There sure is alot to learn but things are going along nicely.the hardest part is the collision detection.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.