-
Notifications
You must be signed in to change notification settings - Fork 143
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
Balls are stuck in mirror positions at intersection point #19
Comments
I got similar results in my Atari 2600 version. But after I improved the block collision detection, the problem disappeared. I only check collision with blocks into the ball's current direction. E.g if the ball moves left and up, I only check the blocks to the left and above. |
They gonna lock each other somewhere else. Mine stuck somewhere in the middle in even tighter position. |
Ok idea to prevent loop (or a cycle of length = 1) - if same 2 positions are repeated as pairs across 4 ticks that means we are in a loop. For 5th tick, we skip and go to 6th tick. This will give a chance for a ball to move twice and clear the loop. Concretely:
Now this prevents cycles of length=1. Its not clear if there could be longer cycles. If indeed, there are cycles of length>1, we can generalize to store last 2*length positions and see if we see the same pair of consecutive position twice |
Left it on for about 30 minutes and it looks like the balls got stuck inside of each other's collision boxes.
Screen.Recording.2024-01-29.at.11.47.10.AM.mov
The text was updated successfully, but these errors were encountered: