-
Notifications
You must be signed in to change notification settings - Fork 142
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
Fixed bounce angle and collision calculation #35
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@vnglst I saw that you have reimplemented some randomness to your code. Have you tested whether this PR resolves the tunneling issues? If you think about merging this PR I would resolve all conflicts. |
Hi @schlagmichdoch, thanks for the effort you've put into this. Looking at your code it seems you've solved some important issues, but the code is also longer and more complex. My original implementation was naive, but easy enough for others to also give it a go. I would like to propose the following: Let's create an alternative version (either to this PR or your Github repo) and link to that from the README.md. How does that sound? |
Sure, go ahead, use this PR as you like, I will leave it as is. I don’t need to get credited, I just like the idea and wanted to offer some improvements to help others get the ball behavior right. I will take another look at your code and try to find some less intrusive ways to optimize the collision detection though. Especially the tunneling problem might be easy to solve with only a few changes :) |
…ooking at all points along circumference
(cherry picked from commit 850e1ca)
Added some logic to enable the ball to move at any angle and calculate the reflection angle physically correct (not always 90°). (should fix #1)
Added a simple loop to calculate (but not draw) every step a ball takes which prevents missing blocks (#22).
Added a detection function to check whether the opposing ball is inside the square that is about to change color. This should fix #6
Supersedes #34