xxxxxxxxxx
function setup() {
createCanvas(600,600);
background(100);
}
function draw() {
//VARIABLES
//Color
let lm = fill(255,255,255);
let nb = fill(32,233,230);
//Eyes
let q = 200; //middle x-point left eye circle and square
let e = 250; //y-point left eye circle
let w = 400; //x-point right eye circle and square
let r = 200; //y-point left eye square
let t = random(5,51); //width of both square eyes
let u = random(5,99); //height of both square eyes
let i = random(10,99); //diameter of the circle eyes
let o = 3/4*i; //diameter of circle inner eye
//Nose Variables
strokeWeight(3);
let p = random(250,301);//y-points of height y1
let a = random(5,51);//half baseline of nose
let s = 300; //middle of nose //x1
let d = 300+a;//x3
let f = 300-a; //x2
let g = 350; //stable y-point
//Mouth Variables
let h = 300;//middle of x-point of mouth
let j = 375;//y-point of mouth
let k = 50;//height of mouth
let l = random(0,101);//half of mouth length
//Ear Variables
let z = 50;//x-point for both left ears
let c = 450;//x-point for both right ears
let v = 250;//y-point of both high ears
let b = 300;//y-point of both low ears
let n = 100; //width of ear
let m = 100; //length of low ear
let qw = 150; //length of high ear
//Antennae Variables
//side of head
let er = 75; //x-point of left antennae
let ty = 300; //y-point of both antennae y2
let ui = 525; //x-point of right antennae x2
let op = 100; //y-point of both antennae y1
let as = random(20, 50); //diameter of circle
//On top of head
let df = 300; //xpoint of antennae
let gh = 50; //y-point of antennae y1
let jk = 150; //y-point of antennae y2
//ANTENAE
//left antennae
line(er, op, er, ty);
circle(er, op, as);
//right antennae
line(ui, op, ui, ty);
circle(ui,op,as);
//on top of head
line(df, gh, df, jk);
circle(df, gh, as);
//EAR
strokeWeight(4);
fill(255,0,0);
//low ear
rect(z, b, n, m);
rect(c, b, n,m);
//high ears
rect(z,v, n,qw);
rect(c,v,n,qw);
//HEAD
fill(255,255,255);
strokeWeight(4);
//rect(x-point, y-point, width, height, roundercorner values)
rect(100,150, 400, 300, 15, 15,0,0);
//SQUARE EYES
strokeWeight(7);
fill(255,0,0);
fill(32,233,230);
rect(q-t,r, t*2, u); //Left eye
rect(w-t,r,t*2,u); //Right eye
noLoop();
//CIRCLE EYES
strokeWeight(5);
fill(0);
ellipse(q,e,i,i); //Left eye
ellipse(w,e,i,i); //Right eye
fill(32,233,230);
ellipse(q,e,o,o); //Left inner eye
ellipse(w,e,o,o); //Right inner eye
//NOSE
strokeWeight(3);
triangle(s,p, f,g, d,g);
//MOUTH
strokeWeight(3);
rect(h-l, j, l*2, k);
//teeth
stroke(255,255,255);
for(i = 0; i<l*2; i+=11){
line(h-l+i, j, h-l+i, j+k);
}
//mouthoutline to cover the teeth
noFill();
stroke(0);
rect(h-l, j, l*2, k);
}