I can't seem to get repulsion to work in my code. I have bubbles that bounce around and I just want them to move away when the mouse pointer gets close to them. Any help would be much appreciated, thanks
!
int numBalls = 12;
float spring = 0.05;
float friction = -0.9;
Ball[] balls = new Ball[numBalls];
void setup()
{
size(600, 600);
noStroke();
smooth();
for (int i = 0; i < numBalls; i++) {
balls[i] = new Ball(random(width), random(height), random(20, 40), i, balls);