This problem is caused from the velocityX being impossibly tiny (7.717558E-5 for example).
so one solution might be setting velocityX to 0 AS IT SHOULD BE when the angle is 90 or -90.
I've tried it and it's not the problem.
Found the source of the bug:
if (ball.velocityY == 0 || ball.x >= ball.range * ball.ratioPXtoM)
ball.velocityY *= -1;
To be honest i have no idea why it was there in the first place, but that happens sometimes...
This problem is caused from the velocityX being impossibly tiny (7.717558E-5 for example).
so one solution might be setting velocityX to 0 AS IT SHOULD BE when the angle is 90 or -90.
I've tried it and it's not the problem.
Found the source of the bug:
To be honest i have no idea why it was there in the first place, but that happens sometimes...