• Advertisement
Sign in to follow this  

breakout bricks

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

Well I am attempting to develop a rountine that handles the brick and ball interaction in a breakout game.I am using c++ and directx9. Here is the code I am using for the collision detection.I have put the code in the Game_Run loop.

int col_index;
(int)col_index = 0.005 * ball_left;
int row_index;
(int)row_index = 0.02 * ball_top;

if(bricks[row_index][col_index]==1)
{
bricks[row_index][col_index]=0;
//draw black brick
RECT rect;
rect.left = col_index*200;
rect.right = col_index*200+200;
rect.top = row_index*50;
rect.bottom = row_index*50+50;
d3ddev->StretchRect(surface_six, NULL, backbuffer, &rect, D3DTEXF_NONE);
y_vel*=-1;
}


Share this post


Link to post
Share on other sites
Advertisement
Honestly. You should struggle with this on your own. You have started 10-20 threads about it already. You'll never be a programmer if you do this. You just come here and ask everything. If you ask anything at all.

(A breakout took me 5 hours to code, okay, I'm experienced)

Share this post


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

  • Advertisement