In the game I am developing, there are 220 circles that are not moving. One of the circles is moving and in every update, it iterates through an ArrayList that contains all the circles and check if it collides with them and if it does, then its velocity is set to 0.
Sometimes, it works perfectly. However,most of the time, when the moving circle collides with another circle, it stops late sometimes when the ball is already inside the other circle. How can I deal with this?
I am using LibGDX with Java.