ianhi_processing/NatureOfCode/The-Nature-of-Code-Examples-master/Processing/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com

Mover m;
Attractor a;

void setup() {
  size(640,360);
  m = new Mover(); 
  a = new Attractor();
}

void draw() {
  background(255);

  PVector force = a.attract(m);
  m.applyForce(force);
  m.update();
  
  a.drag();
  a.hover(mouseX,mouseY);
 
  a.display();
  m.display();
}

void mousePressed() {
  a.clicked(mouseX,mouseY); 
}

void mouseReleased() {
  a.stopDragging(); 
}





