Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paddle/Pong - ball should not run along upper/lower wall boundaries #1084

Closed
1 task done
Danimations opened this issue Apr 12, 2022 · 5 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@Danimations
Copy link

Verification

  • I searched for similar bug reports and found none was relevant.

What happened?

Ball runs parallel/along upper or lower wall sometimes

What should happen instead?

Ball should bounce at any angle other than parallel with upper or lower wall when at that position

Reproduction steps

Play the game. When the ball is hit precisely into the corner of the playing field, it sometimes (quite often) bounces off the back wall and travels parallel with the upper or lower wall. Sometimes this effect lasts for several consecutive bounces. While the game remains functional and doesn't trap the player in an infinite loop, this ball behavior feels broken and could be improved.

More details?

In my opinion this should not happen at all. Broadly speaking, the physics of the game could benefit from some other improvements, but I consider this one to be an actual bug rather than a design issue. I'd like to see it excluded from future versions.

Version

1.9.0

Companion app

No response

@Danimations Danimations added the bug Something isn't working label Apr 12, 2022
@minacode
Copy link
Contributor

minacode commented Apr 12, 2022

I read the code. It seems, that the ball is not kept in the bounds. So it maybe glitches into the upper or lower walls and zig-zags, because each update does dy *= -1.
That could seem like parallel, if dy is small enough.
I did not test this.

@NeroBurner
Copy link
Contributor

does the ball travel "stick" to the upper or lower wall? Or does the ball just travel in a straight height (away from the upper/lower wall)?

The second one could be just the random dy introduced by me in #797

@Danimations
Copy link
Author

Hi @NeroBurner . Yes, the ball travel "sticks" to the upper or lower wall sometimes... traveling immediately alongside the wall, and rolling parallel to it. I had to play the game long enough to score 32 points or so in order to see this bug repeat a few times.

@Danimations
Copy link
Author

So I just had another decent round of Pong and it seems that the last bug fix to this app also solved the problem described here. So the ball running along the top or bottom walls may have been a consequence of a bat/ball impact occurring with the bat partly off screen. I gather no-one else has encountered this bug lately?

@NeroBurner
Copy link
Contributor

good to hear, I was never able to reproduce this bug. Closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants