ChristineSeo-Project-02-SectionC

sketch

// Christine Seo
// Section C
// mseo1@andrew.cmu.edu
// Project-02
var xPos;
var yPos;
var xR;
var scale;
var eyeScale;
var curve;
var shirtH;
var shirtW;
var hatR;
var earSize;
var eyeW;
var eyeH;
var earringS;
var mouthH;
var headS;
var faceS;
var circleG;
var circleB;
var skinR;
var skinG;
var skinB;
var neckR;
var neckG;
var neckB;
var faceWidth = 100;
var faceHeight = 160;
var hairLength= 155;
 
function setup() {
  createCanvas(480, 640);
  xPos = random(0,width); 
  yPos = random(0,height);
  xR = random(10,width);
  scale=random(10,height);
  shirtR=random(10,width);
  harR=random(10,width);
  eyeScale=random(10,20);
  earSize=random(25,45);
  curve=20
  shirtH=80
  shirtW=185
  eyeW=140
  eyeH=210
  earringS=210
  mouthH=240
  headS=180
  faceS=80
  circleG=90;
  circleB=80;
  skinR=247;
  skinG=225;
  skinB=200;
  neckR=231;
  neckG=195;
  neckB=156;

}

 
function draw() {

  background(46, 47, 69);
  noStroke(0);

  //circles
  fill(xR,circleG,circleB);
  ellipse(xPos, yPos, scale,scale); 
  

  //neck
  fill(neckR, neckG, neckB);
  rect(width/2-80, height/3, faceWidth/2-15, width/4.2, curve/2);


  //shirt
  fill(shirtR,circleG,circleB);
  rect(width/3.84, height/2.1, shirtH, shirtW, curve);

  //shoulders
  fill(skinR, skinG, skinB);        
  rect(height/3.5, height/2.2, shirtH-35, shirtW+40, curve);
  rect(width/3.84, height/2.1, shirtH-70, shirtW+10, curve);

  //hair
  fill (141, 114, 41);
  ellipse(width/2.91,height/3.6,width/3.2,height/3.8);
  rect(height/7, width/2.6, width/7, hairLength);

  //ears
  fill(neckR, neckG, neckB);
  ellipse(width/3.84,earringS,height/18,earSize);

  //earring
  fill(1);
  rect(width/4.5,earringS,earringS/30,earringS/30);

  //face
  fill (skinR, skinG, skinB);
  ellipse(width / 3, height /3, faceWidth,  faceHeight);

  //eyes
  fill(1);
  ellipse(eyeW,eyeH,eyeW/7,eyeScale);
  fill(990);
  ellipse(eyeW,eyeH,eyeW/17,eyeScale);

  //nose
  stroke(1);
  line(eyeW, eyeH+30, width/2.5, width/3);
  line(eyeW,eyeH+30,width/3.2,mouthH);
  ellipse(width/3,mouthH,width/160);

  //mouth
  noStroke(0);
  fill(236, 185, 248);
  triangle(width/2.5,mouthH,width/2.8,width/2,width/3.2,height/2.5);

  //bangs
  noStroke(0);
  fill(141, 114, 41);
  translate(width/-9, height/2.95);
  rotate(PI/0.6);
  ellipse(width/3,headS,faceS,width/4);

  //hat
  fill(1);
  translate(width/1.6, height/35);
  rotate(PI/2);
  ellipse(height/4,width/4-3,height/2.5,width/20);
  rect(faceS,height/48,headS,width/4.8);
  fill(hatR, circleG,circleB);
  rect(faceS,height/9,headS,width/24);

}
function mousePressed() {

  xPos = random(0,width); 
  yPos = random(0,height);
  xR = random(10,width);
  scale= random(10,height);
  eyeScale= random(10,20);
  shirtR= random(10,width);
  hatR=random(10,width);
  faceWidth = random(75, 100);
  faceHeight = random(110, 150);
  hairLength = random(120,255);
  earSize= random(25,45);



}

Although I had difficulties in the beginning of using variables, I was able to find the convenience of them! I experimented with different shapes and sizes. It was great to learn about how much I could play around with the software; it makes everything so much more dynamic!

Leave a Reply