//Zaku's head //First Assinment for Processing //Chapters 1-3 //By Zhongyuan Ma void setup() { size(400, 400); smooth(); rectMode(CORNERS); } void draw() { background(0); //head noStroke(); fill(255,95,95); ellipse(200,200,160,170); rect(120,200,280,240); stroke(0); rect(195,20,205,170); //window stroke(0); fill(0); rect(140,185,260,215); //eye stroke(216,216,216); strokeWeight(2); fill(255,0,0); ellipse(200+mouseX/9-10,200,30,30); //face noStroke(); fill(201,65,65); quad(130,185,140,185,140,215,130,225); quad(260,185,270,185,270,225,260,215); fill(222,72,72); quad(140,215,200,215,200,270,130,225); quad(200,215,260,215,270,225,200,270); stroke(0); rect(195,220,205,235); //pipeline stroke(0); fill(233,247,37); rect(85,240,315,275); fill(215,229,19); triangle(120,185,120,240,85,240); triangle(280,185,280,240,315,240); line(135,240,135,275); line(110,240,110,275); line(265,240,265,275); line(290,240,290,275); line(98,220,120,220); line(110,200,120,200); line(280,220,302,220); line(280,200,290,200); //mouth stroke(0); fill(255,95,95); rect(160,235,240,280); fill(222,72,72); quad(155,240,160,235,160,280,155,275); quad(240,235,245,240,245,275,240,280); fill(201,65,65); quad(175,260,225,260,230,270,170,270); fill(255,95,95); rect(170,270,230,300); fill(216,216,216); rect(175,275,225,295); line(175,280,225,280); line(175,285,225,285); line(175,290,225,290); } void mousePressed() { noStroke(); fill(225,0,0,191); triangle(200,120,210,190,190,190); triangle(210,190,270,200,210,210); triangle(210,210,200,270,190,210); triangle(190,190,190,210,130,200); rect(190,190,210,210); }