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

Fix ball collisions with walls and paddle #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ShadowLordAlpha
Copy link

This fixes the paddle clipping into the lower wall when moving down, The ball clipping half way into the 3 side walls before detecting the collision, and the ball clipping into the paddle before bouncing

When colliding with the lower wall the paddle would incorrectly go to far before stopping. This fixes the order of operations to correct when the paddle stops
The Ball was going half way into the side walls instead of bouncing off directly due to the collision code not taking into account the thickness of the ball to its center. As we are storing the position of the ball as its center we also need to take that into account when colliding
Adjust the x positions for checking the ball collision with the paddle so the ball bounces before getting half way through the paddle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant