This sketch is the same as the bouncing bubbles on the topics section (thank you keith). The an adjustment I am making is supposed to treat cursor like the walls and bounce off accordingly however I am doing something wrong. Any help would be nice. The portion ( I think ) that needs to be changed is the lower portion of "void move ()" starting on the third else.
PImage a;
int numBalls = 35;
float spring = .04;
float gravity = 0.03;
float friction = -0.9;
Ball[] balls = new Ball[numBalls];
void setup()
{
size(640, 600);
noStroke();
smooth();
for (int i = 0; i < numBalls; i++) {
balls[i] = new Ball(random(width), random(height), random(20, 40), i, balls);