Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Phil Wood

Greenhorn
+ Follow
since Aug 12, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Phil Wood

Thanks that seems to have sorted the problem out, like you say it is still a little bit jerky at times, but I can live with that for now, still got a few things I want to implement.

One very small issue I have is, Why when I click the mouse to start the game, sometimes it takes three or four clicks before it starts, but on the gameover screen and the win screen, its seems to work every time??
10 years ago
Sorry, half asleep, click the wrong thing, apologies.
10 years ago
Thanks that seems to have sorted the problem out, like you say it is still a little bit jerky at times, but I can live with that for now, still got a few things I want to implement.

One very small issue I have is, Why when I click the mouse to start the game, sometimes it takes three or four clicks before it starts, but on the gameover screen and the win screen, its seems to work every time??

10 years ago
Ok so the best way I've found to replicate this is to change the

to BALL_DELAY = 100, I actually think I accidently left it at this speed in my code posted before, apologies. It occurs if you pass the paddle through the center of the ball ass it passes it.

My guess is that as the paddle collides with the ball one collision point flips the vertical velocity (vy) to the negative and this become flipped again by another collision point hitting the paddle.

If you time this right, you can get the ball stuck to the paddle, I have partially solved it, but if the bottom two corners of the collision rectangle around the ball hit the paddle at the same time it becomes glued to the paddle. The same i assume also happens with the top collision points.

Hope this is enough informations, also thanks for your response.

10 years ago
Here is my Code for a java breakout game below:



My problem is that I have a bug where when I move the paddle towards the ball as it is passing it appears two of my collision points are within the paddle and therefore the ball keeps repeatedly bouncing up and down within the paddle.
Is there anyway i can check that this is not occuring, or is there another more simply solution.

thanks
10 years ago