Jenna Kim (Jeeyoon Kim)- Project 5- Wallpaper

jennakim05

/* Jenna Kim (Jeeyoon Kim)
Section E
jeeyoonk@andrew.cmu.edu
Week 5 Project: Mr. Avocado and Ms. Eggy
*/
function setup() {
    createCanvas(600, 600);
    noStroke();
}

function draw() {
    background(245, 138, 125);

    for (var y = 0; y < height; y += 100) { //avocado peel
        for (var x = 0; x < width; x += 70) {
            fill(79, 50, 54);
            ellipse(x, y, 30, 30);
            ellipse(x, y + 30, 40, 40);
      }
    }
    for (var y=0;y < height;y += 100){ //inside of avocado
      for (var x = 10;x < width;x += 70){
        fill(204, 228, 182);
        ellipse(x - 10, y, 25, 25);
        ellipse(x - 10, y + 25, 35, 35);
        fill(79, 50, 54); 
        ellipse(x - 15, y, 3, 3); //left eye
        ellipse(x - 7, y, 3, 3); //right eye
      }
    }

    for (var y = 0;y < height;y += 100){ //avocado seed!
      for (var x = 10;x < width;x += 70){
        fill(79, 50, 54);
        ellipse(x - 10, y + 30, 15, 15);
      }
    } 
    for(var y = 70;y < height * 3 / 2;y += 100){ //egg! 🙂
    for(var x = 30;x < width;x += 70){
      fill(255); //white part
      ellipse(x, y, 40, 50);
      fill(252, 210, 94); //yolk
      ellipse(x, y, 20, 20);
      fill(252, 210, 94); //eyes
      ellipse(x - 10, y - 10, 4, 4); //left eye
      ellipse(x + 10, y - 10, 4, 4); //right eye
    }
  }
    noLoop();
}

For this project, I designed a pattern for a kind of pajamas I want for myself. 🙂
I made a pattern of avocados and eggs, my favorite food. Although this project was also challenging as the assignments a and b, I enjoyed using my creativity and apply what I learned from this week’s lecture and recitation. Through keep experimenting with the coding, I started to understand the loops fully than before. I know that next time, I can further improve by using % operator.

Leave a Reply