Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
8
Reply
Brickbreaker ball/paddle bounce issues
Jamie Wyatt
Apr 29 2011 9:01 PM
5.4k
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
8
)
Next Recommended Forum
need help with Knight's tour game in c# xna
Is there a limit in drawn objects?