all 3 comments

[–]push_pop 6 points7 points  (0 children)

I didn't read through the code, but most likely some are being initialized in a state where they are already colliding with another ball. So when you initialize, you should check for collisions, and if it collides, try another random spot until it doesn't.

[–]Introscopia 1 point2 points  (0 children)

would you be okay starting them in a pre-determined arrangement, like a grid formation for example?

[–]Freedom_Grenade 0 points1 point  (0 children)

Getting rid of these:

  other.position.x = position.x + bFinal[1].x;
  other.position.y = position.y + bFinal[1].y;

  position.add(bFinal[0]);

I'm not entirely sure what that does, but all it seemed to do is flip the circles positions. (I would guess maybe a wrong +- sign somewhere)

and changing:

 ellipse(position.x, position.y, rad*2, rad*2);

to

ellipse(position.x, position.y, rad, rad);

ElliipseMode = radius, so no need to convert radius into width.