// head & shoulders #2b
float horizon;
float zoogX, zoogY, zoogDX=0.2, zoogDY=0.1;

void setup() {
  size( 600, 400 );
  horizon=  height/4;
  reset();
  
}
void reset() {
  zoogX=  width/4;  
  zoogY=  height/3;
}
void draw() {
  scene();
  action();
  messages();
}
void action() {
  // Move Zoog
  if (zoogX>width) reset();
  if (zoogY>height) reset();
  zoogX = zoogX + zoogDX;
  zoogY = zoogY + zoogDY;

  // Draw Zoog(s);
  showZoog( zoogX, zoogY ) ;
  showZoog( zoogX+100, zoogY+50 ) ;
  showZoog( zoogX+150, zoogY+100 ) ;

}

void showZoog( float x, float y ) {

    fill(255,255,0);
  rect( x, y, 60, 120 );
  ellipse( x+30, y-20, 40, 40 );

  fill(0);
  text( "Zoog", x+5, y+15 );
}

void messages() {
  // +++
}

void scene() {
  background(200, 220, 250);
  fill( 200, 255, 220 );
  rect( 0, horizon, width, height );
}
