// sketch.js var noff = 0.0; var n0 = 100; var n; var moff = 0.0; var m0 = 150; var m; function setup() { var cnv = createCanvas(640, 400); cnv.position(24, 140); background(127); } //setup function draw() { noff = noff + .01; n = noise(noff) * n0; moff = moff + .01; m = noise(moff) * m0; drawFace(); drawEyes(); drawPupils(); drawRings(); drawSmile(); } //draw function drawFace() { noStroke(); fill(255, 225, 0); ellipse(width/2, height/2, 400, 400); } //drawFace function drawEyes() { noStroke(); fill(255); ellipse(width/2 - 80, height/2 - 60, 100, 100); // left ellipse(width/2 + 80, height/2 - 60, 100, 100); // right } //drawEyes function drawPupils() { noStroke(); fill(0); ellipse(width/2 - 80 +n-n0/2, height/2 - 60, 40, 50); // left ellipse(width/2 + 80 +n-n0/2, height/2 - 60, 40, 50); // right } //drawPupils function drawRings() { noFill(); stroke(255, 225, 0) strokeWeight(40); ellipse(width/2 - 80, height/2 - 60, 130, 130); // left ellipse(width/2 + 80, height/2 - 60, 130, 130); // right } //drawRings function drawSmile() { stroke(0); strokeWeight(8); noFill(); arc(width/2, height/2, m0+m, m0+m, 0.25, PI-0.25); } //drawSmile