Jamie Wyatt

Jamie Wyatt

  • NA
  • 14
  • 10.3k

Brickbreaker ball/paddle bounce issues

Apr 29 2011 9:01 PM
Evening all,

Having a few issues finishing my brickbreaker university project. As it stands the game will start and run, all of the bricks are happy to be hit by the ball, killed by the ball and have the ball bounce off. However, I've tried to use the same code (if (ballRectangle.Intersects(batRectangle)) to get the ball to bounce off the paddle but it's not having any of it.

I've attached the source code, there is also currently a save method in there that I can't get to work (see my other thread - http://www.c-sharpcorner.com/Forums/Thread/120430/saving-an-int-to-a-txt-file.aspx) but it's commented out so it shouldn't cause any compilation issues.

Any help you could offer would be great.

Cheers,
J.

EDIT : Slight update on this, it seems if the ball hits the area that the paddle starts off (dead centre) the ball will bounce as if the paddle is there, regardless of it's actual position.

Does this mean I'm moving the texture but not the rectangle? Is that possible?



Attachment: breakout.rar

Answers (8)