//PCS sixth grade complete the animals again....
//We are back using the usual grid (0, 0 in upper left) +x to right, +y down
//Fill in either the cat or the panda + add a body or color
//then make it move

//TODO fill in the rest of the cat face + add a body
void DrawCat(float tx, float ty) {
  stroke(0);
  strokeWeight(3);

  pushMatrix();
  translate (tx, ty);
  
  //TODO add code for the body here after the face is complete
  
  //ears
  fill(128);
  triangle(250, 400, 200, 150, 400, 250);
  triangle(400, 250, 600, 150, 550, 400);
  //head
  fill(255);
  ellipse(400, 400, 300, 300);
  //eyes
  fill(128);
  ellipse(320, 400, 100, 80);
  ellipse(470, 400, 100, 80);

  //TODO: FILL in the pupils

  //mouth
  line(400, 420, 400, 480);
  line(400, 480, 350, 500);

  //TODO: FILL in the side of the mouth

  //TODO: Fill in the nose

  popMatrix();
}

void DrawPanda(float tx, float ty) {
  stroke(0);
  strokeWeight(3);

  pushMatrix();
  translate (tx, ty);
  
  //TODO add code for the body here after you finish the face
  
  //ears
  fill(0);
  ellipse(250, 250, 200, 200);

  //TODO FILL in right ear

  //head
  fill(255);
  ellipse(400, 400, 350, 350);
  //eyes
  fill(0);
  ellipse(450, 375, 100, 200);
  //TODO FILL in left eye black spot

  fill(255);
  //TODO FILL in left eye white spot
  ellipse(450, 375, 50, 100);
  
  fill(128);
  //TODO FILL in left eye grey pupil
  ellipse(450, 375, 50, 20);
  
  //mouth
  line(350, 500, 450, 500);

  popMatrix();
}

//variables to move the animal
int vx, vy;
int px, py;

void setup() {
  //size(screen.width, screen.height);
  size(800, 800);
  vx = -1;
  vy = 0;
}

void draw() {
  background(255);

  //update the postition of the animal using velocity
  px = px + vx;
  py = py + vy;

  //draw an animal - to make it start moving change (0, 0) to (px, py)
  DrawCat(0, 0);
  //TODO : change animal if desired
  //DrawPanda(0, 0);

  //You can control the logic to change the direction the animal is traveling
  //if the animal hits a certain position, it can change velocity
  if (px < -200) {
    vx = 1;
    vy = 0;
    px = -200;
  }

  //TODO add logic to change the direction if the animal reaches a different position
}