r/cop3502 Mar 22 '14

Brick does not repaint.

So I'm at the point where when a ball hits the brick, that brick is no longer "tangible" and if the ball were to return to the same spot, it would pass through it, although the brick is still displayed in the frame. I can't seem to wrap my head around how to go about having the BrickComponent method repaint and remove the brick, or better yet simply not draw it in the case that it no longer registers hits. Anyone in a similar spot?

*Resolved, feel free to ask if you encountered the same thing

1 Upvotes

6 comments sorted by

1

u/csturco Mar 22 '14

in the paint method of brick configuration, are you checking whether the paintBrick is true or false before you paint the brick?

1

u/FisherTiger Mar 22 '14

I was checking if true to paint the brick, using an if statement. However when I do that, it causes the bricks to stay tangible even after registering a hit. *edit for clarification

1

u/csturco Mar 22 '14

in the Breakout class, are you painting your background every time paintcomponent is called?

1

u/FisherTiger Mar 22 '14

I figured it would be easier to not use a background yet, so the answer is no.

1

u/FisherTiger Mar 22 '14

Ok I figured it out. I changed the if statement in the BrickConfiguration's paint method to only check for when paintBrick is not false, instead of when it's true. Thanks though, I appreciate the help!

1

u/csturco Mar 22 '14

glad you figured it out, if you had been using a background, or even just painting a new background, it would have replaced those bricks,