Skip to content

Instantly share code, notes, and snippets.

@mrzachxu
Last active October 9, 2018 23:46
Show Gist options
  • Save mrzachxu/564c02b236cd64818496451977095512 to your computer and use it in GitHub Desktop.
Save mrzachxu/564c02b236cd64818496451977095512 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(2000,2000);
background(0,0,0);
angleMode(DEGREES);
// brownhead();
peachhead();
// normalhead();
smilingmouth();
ehmouth();
squirrelmouth();
sadmouth();
bracesmouth();
let mouthFunctions = [smilingmouth, squirrelmouth, bracesmouth, sadmouth, ehmouth]; //make an array of mouthFunctions
let randomMouth = mouthFunctions[int(random(0, mouthFunctions.length))]; //choose a random one from the list and store it in the randomMouth variable
//the randomMouth variable now refers to a function we can run
randomMouth();
// normaleyes();
// rollingeyes();
lookingrighteyes();
// crying();
}
function draw() {
}
function smilingmouth(){
fill(255,255,255);
arc(100,105,70,70,0,180,PIE);
}
function squirrelmouth(){
stroke(0,0,0)
line(70,113,127,113)
fill(255,255,255)
rect(75,113,20,40)
rect(100,113,20,40)
}
function ehmouth(){
line(70,120,127,120)
}
function sadmouth(){
fill(255,255,255)
arc(100,130,50,40,180,0,PIE);
}
function bracesmouth(){
fill(0,0,0)
rect(68,110,60,20)
fill(255,255,255)
rect(68,80,10,10)
}
function normalhead(){
fill(244,226,66);
ellipse(100,100,100,100);
}
function brownhead(){
fill(71,44,44);
ellipse(100,100,100,100);
}
function peachhead(){
fill(255,194,124);
ellipse(100,100,100,100);
}
function normaleyes(){
fill(127,127,127);
ellipse(80,85,20,20);
ellipse(117,85,20,20);
}
function rollingeyes(){
fill(255,255,255)
ellipse(80,85,30,30);
ellipse(117,85,30,30);
fill(0,0,0);
ellipse(85,77,15,15);
ellipse(120,77,15,15);
}
function lookingrighteyes(){
fill(255,255,255)
ellipse(80,85,30,40);
ellipse(117,85,30,40);
fill(0,0,0);
ellipse(88,83,15,15);
ellipse(125,83,15,15);
}
function crying(){
fill(66,167,244);
stroke(255,255,255);
bezier(127, 91, 143, 165, 200, 95, 127, 91);
bezier(70, 92, 2, 102, 63, 171, 71, 91);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment