//////// What am I trying to do???
//////// Dymon Harris  (CST 112; today's date?)

//// GLOBALS:  coordinates, speed, etc.
float x, y;       // Position of cloud.
float mickeyX, mickeyY;       // Position of Mickey.
float dx, dy;     // Speed.
float mickeydx, mickeydy;     // Speed Of Mickey.
float horizon;

//// SETUP:  window size, initialization (start in middle of screen).
void setup() {
 size(600,600);
  horizon=  height/4;
  x=  width/2;
  y=  height/2;
  dx=  3;
  dy=  2;
}

//// NEXT FRAME:  scene, action, show.
void draw() {
//// Background & Size


background(255);

//// Sky

fill(0,200,200);     // Color Of Sky
rectMode(CENTER);
rect(0,0, 1200,500); // Shape Of Sky

//// Cloud
float cloudX=50, cloudY=50, cloudW=100, cloudH=40;
  cloudX=  x + dx;
  y=  y + dy;

  
fill(255);                                // Color Of Cloud
ellipse(cloudX, cloudY, cloudW, cloudH);  // Shape Of Cloud


//// House

fill(117,0,0);            // Color Of House
rectMode(CENTER);
rect(300,200,  100,100);  // House Dimensions

//// Roof

fill(117,0,0);                         // Color Of Roof
triangle(300,90,  380,150,  220,150);  // Roof Dimensions

//// Door

fill(150);              // Color Of Door
rectMode(CENTER);
rect(300,225, 35,50);   // Shape Of Door

fill(10);               // Color Of Door Knob
ellipseMode(CENTER);
ellipse(312,228, 6,6);  // Shape Of Door Knob

//// Window
for (int i = 200; i < 220; i++) {
  float r = random(200);           // Flickering Window Effect
  fill(r*4);
rectMode(CENTER);
rect(330,180, 35,35);       // Shape Of Window

fill(0);  
line(313,180, 347,180);
line(330,163, 330,196);
}
//// Grass

fill(100,200,100);       // Color Of Grass
rectMode(CENTER);
rect(0,495,  1200,490);  // Shape Of Grass


//// Sun

fill(255,255,0);         // Color Of Sun 
ellipseMode(CENTER);
ellipse(560,40, 70,70);  // Shape Of Sun


//// Tree

fill(127,70,0);         // Color Of Bark
rectMode(CENTER);
rect(130,200, 50,100);  // Shape Of Bark

fill(100,200,100);        // Color Of Leaves
ellipse(100,150, 60,60);  // Leaf 1
ellipse(160,150, 60,60);  // Leaf 2
ellipse(130,110, 60,60);  // Leaf 3


//// Tree #2

fill(127,70,0);           // Color Of Bark
rectMode(CENTER);  
rect(460,200, 50,100);    // Bark Dimensions

fill(100,200,100);        //Color Of Leaves
ellipse(430,150, 60,60);  // Leaf 1
ellipse(490,150, 60,60);  // Leaf 2
ellipse(460,110, 60,60);  // Leaf 3

//// Creature

float mickeyX=60, mickeyY=265, mickeyW=60, mickeyH=60;
  mickeyX=  x + dx;
  mickeyY=  y + dy;


fill(20);                // Color Of Ears
ellipse(mickeyX, mickeyY, mickeyW, mickeyH); // Body Shape
ellipse(mickeyX-20, mickeyY-35, mickeyW-25, mickeyH-25); // Left Ear
ellipse(mickeyX+20, mickeyY-35, mickeyW-25, mickeyH-25); // Right Ear
fill(255,0,0);           // Color Of Bottoms
arc(mickeyX, mickeyY, mickeyW-2, mickeyH-2, 0, PI+QUARTER_PI, CHORD);  // Shape Of Bottoms


fill(100);
text("My name is Dymon Harris", 10,590);  /// My Name

//// ACTION:  move (x,y) coordinates.
  x=  x + dx;
  y=  y + dy;
  
}


//////// HANDLERS:  mouse clicks, keys
void mousePressed() {
  x=  mouseX;                             // Set (x,y) to mouse
  y=  mouseY;
  //
  dx=  random( -6, +6 );                  // random speed.
  dy=  random( -4, +4 );
}

void keyPressed() {
  if (key == 'q') {
    exit();                           // press 'q' key to QUIT.
  }
}



   








