// head & shoulders
float horizon;
float zoogX, zoogY, zoogDX=0.2, zoogDY=0.1;

void setup() {
  size( 800, 600 );
  horizon=  height/4;
  reset();  
}
void reset() {
  zoogX=  50;  
  zoogY=  horizon-50;
}

void draw() {
  scene();
  action();
  messages();
}
void action() {
  // Move Zoog
  if (zoogX>width) reset();
  if (zoogY>height) reset();
  zoogX = zoogX + zoogDX;
  zoogY = zoogY + zoogDY;
  
  int n=0, shift=0;

  // Draw Zoog(s)
  fill(255,0,255);
  text( "Zoog(s)", zoogX, zoogY-50 );

  n=  n+1;
  fill( 255,0,0 );
  rect( shift+zoogX, shift+zoogY, 60, 120 );
  ellipse( shift+zoogX, shift+zoogY, 40, 40 );
  fill(0);
  text( shift, shift+zoogX, shift+zoogY );
  
  n=  n+1;
  shift=  shift+100;
  fill( 0,200,0 );
  ellipse( shift+zoogX, shift+zoogY, 40, 40 );
  rect( shift+zoogX-20, shift+zoogY+20, 60, 120 );
  fill(0);
  text( shift, shift+zoogX, shift+zoogY );

  n=  n+1;
  shift=  shift+100;
  fill( 0,0,255 );
  rect( shift+zoogX, shift+zoogY, 60, 120 );
  ellipse( shift+zoogX+30, shift+zoogY-20, 40, 40 );
  fill(0);
  text( shift, shift+zoogX, shift+zoogY );
}

void messages() {
  // +++
}

void scene() {
  background(200, 220, 250);
  fill( 150, 250, 150 );
  rect( 0, horizon, width, height );
}

//// EVENTS ////
void mousePressed() {
  if (mouseY>horizon) {
    zoogX=mouseX;
    zoogY=mouseY;
  }
}
  

