processing source Robot3-1

float x = 60;
float y = 440;
int radius = 45;
int bodyHeight = 160;
int neckHeight = 70;

float easing = 0.05;


void setup() {
size(800, 480);
strokeWeight(2);
ellipseMode(RADIUS);
}

void draw() {


int B = int(random(16));
int N = B * 5;


int targetX = mouseX;
x += (targetX -x) * easing;
if (mousePressed) {
neckHeight = 10 + B;
bodyHeight = 20 + N;
}
else {
neckHeight = 50 + B;
bodyHeight = 90 + N;
}
float ny = y - neckHeight - bodyHeight - radius;
background(204);

//neck
stroke(102);
line(x+12, y - bodyHeight, x+12, ny);

//antena
line(x+12, ny, x-18, ny-43);
line(x+12, ny, x+42, ny-99);
line(x+12, ny, x+78, ny+15);

//body
noStroke();
fill(102);
ellipse(x, y-33, 33, 33);
fill(0);
rect(x-45, y-bodyHeight, 90, bodyHeight-33);

//head
fill(0);
ellipse(x+12, ny, radius, radius);
fill(255);
ellipse(x+24, ny-6, 14, 14);
fill(0);
ellipse(x+24, ny-6, 3, 3);
}