+ 1

Why does one of the balls stop in space and just vibrate?

https://code.sololearn.com/WTfJ4ggI2J5B/?ref=app It doesn’t happen often, but a ball will sometimes stop moving and just stay vibrating. I’ve noticed that this activity also makes the ball sticky and other balls get caught onto the one For the most part, the balls bounce off each other like they are supposed to. I just haven’t been able to figure out the behavior yet. I think it may stem from the prototype function on line 100 that causes ball to ball collision, if anyone has any insight it’d be greatly appreciated.

25th Jan 2019, 6:50 PM
Thomas Czernek
Thomas Czernek - avatar
3 Answers
+ 1
This code is very long and would take a while to study but having delt with a similar problem a guess would be that theres somthing wrong with the values in between line 109 - 123;
26th Jan 2019, 12:37 AM
D_Stark
D_Stark - avatar
+ 2
Is this what your looking for? https://code.sololearn.com/Wat761UACSFu I think what's happening is the balls collide and something get stuck on the edge of something and bounce back and forth very fast.
26th Jan 2019, 3:41 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
0
on the line no 55 if radius is 3 balls won't vibrate
31st Jan 2019, 5:09 AM
trupti shelar
trupti shelar - avatar