+ 1
Canvas collision detection not working properly
Hi! I have made a canvas in which balls collides with eachother and changes its direction after collision. Mine problem is collisoin related, it has nothing to do with canvas. When you will make many balls in web app then balls will start to stuck in eachother. Even if there are only two balls, there is possibility that they will stuck in each other and start vibrating. Problem is in update method of Circle class Can anyone please help me to solve this issue?? https://code.sololearn.com/W84lUKvncOyw/#
4 Answers
+ 1
+ 1
David Dolejší
You are right
When balls intersect each other then they start changing directions periodically
I have to find some way so that they do not intersect or after intersection they come out of each other right after next frame