//Cora Hickoff
//Section D 9:30AM-10:20AM
//chickoff@andrew.cmu.edu
//Project-02
var faceWidth = 350;
var faceHeight = 300;
var eyeSize = 20;
var pupilSize = 9;
var beakSize = 50;
var x = 170;
function setup() {
createCanvas(640, 480);
}
function draw() {
background(130,180,200);
//face
strokeWeight(0);
fill(235,235,235);
ellipse(width / 2, height / 2, faceWidth, faceHeight);
//body
strokeWeight(0);
fill(235,235,235);
ellipse(340,430,270,250);
//beak
strokeWeight(0);
fill(255,220,25);
rect(width / 10, height / 2, x, beakSize);
//feather 1
strokeWeight(0);
fill(220,220,220);
ellipse(370,440,20,100);
//feather 2
strokeWeight(0);
fill(200,200,200);
ellipse(380,440,20,120);
//feather 3
strokeWeight(0);
fill(180,180,180);
ellipse(390,440,20,100);
//feather 4
strokeWeight(0)
fill(200,200,200);
ellipse(400,440,20,90);
//eyes
strokeWeight(2);
fill(250,250,210);
var eyeLX = width / 3 - faceWidth * 0.12;
var eyeRX = width / 2 + faceWidth * 0.25;
ellipse(eyeLX, height / 2, eyeSize, eyeSize);
ellipse(eyeRX, height / 2, eyeSize, eyeSize);
//pupils
strokeWeight(2);
fill(0,0,0);
var pupilLX = width / 3 - faceHeight * 0.12;
var pupilRX = width / 2 + faceWidth * 0.25;
ellipse(pupilLX, height / 2, pupilSize, pupilSize);
ellipse(pupilRX, height / 2, pupilSize, pupilSize);
}
function mousePressed() {
// when the user clicks, these variables are reassigned
// to random values within specified ranges. For example,
// 'faceWidth' gets a random value between 75 and 150.
faceWidth = random(200, 350);
faceHeight = random(200, 300);
eyeSize = random(20, 30);
pupilSize = random(7,11);
beakSize = random(30,50);
beakWidth = random(10,50);
}
When creating this project, I was originally hoping to make a dog of some sort. I made a lot of sketches for this, trying to simplify the shapes. However I ended up changing my direction after a happy accident. When I wrote the code to create a rectangle, it turned out to be yellow because of the color variables I had randomly set. I immediately thought it looked like a seagull’s beak and so I went with it!