xxxxxxxxxx
97
let y;
let x;
let a;
let b;
let r1;
let r2;
let r3;
let r4;
function setup() {
createCanvas(400, 400);
}
function mousePressed() {
x = random(-44, 44);
y = random(-25, 0);
a = random(-44, 44);
b = random(-25, 0);
r1 = random(6, 8);
r2 = random(2, 4);
r3 = random(6, 8);
r4 = random(2, 4);
}
function keyPressed() {
r1 = 0;
r2 = 0;
r3 = 0;
r4 = 0;
mouseX = 0;
mouseY = 0;
}
function draw() {
background(255);
translate(200, 200);
//nose body
push();
fill(237, 179, 137);
noStroke();
ellipse(0, -25, 100, 100);
push();
fill(255);
rect(-50, -25, 100, 50);
pop();
rect(-50, -25, 100, 40);
ellipse(-40, 15, 20, 20);
ellipse(0, 15, 20, 20);
ellipse(40, 15, 20, 20);
fill(255);
rotate(150);
ellipse(50, -20, 15, 45);
pop();
//snot
noStroke();
fill(10, 203, 228);
ellipse(20, 15, 20, 20);
ellipse(-20, 15, 20, 20);
//right snot
rect(10, 15, 20, mouseY / 10);
ellipse(20, 15 + mouseY / 10, 20, 20);
//left snot
rect(-30, 15, 20, 40 + mouseX / 8);
ellipse(-20, 55 + mouseX / 8, 20, 20);
fill(255);
ellipse(-17, 35 + mouseX / 16, 5, 30 + mouseX / 8);
//whelk
fill(230, 0, 0);
ellipse(x, y, r1, r1);
ellipse(a, b, r3, r3);
fill(255, 255, 255);
ellipse(x, y, r2, r2);
ellipse(a, b, r4, r4);
}