yep there is
there are alot of things that prevent it from running correct.
first is you are changing x and y to make it jitter but your face actually doesnt cointain these variables. there is still a rect that does, but its drawn white, so you cant see it.
do you want it to wander arround? or just to jitter ? cause then you shouldnt continuesly add -5,5 to x,y
and you have to call background in draw again to reset the background everyframe.
what i do now, instead of drawing everypart of your face to a different coordinate is translating the matrix using translate();
that makes it easier to add whatever you want to your face without taking care of the jittering again
it then looks something like this :
void setup(){
size(400, 400);
}
void draw() {
background (255);
if (mouseX >100 && mouseX < 300 && mouseY >= 100 && mouseY <= 300)
translate(random(-5, 5),random(-5,5));
fill(0);
rect(100,100,200,200);
fill(255);
rect (140, 120, 45, 45);
rect (220, 120, 45, 45);
fill(255,0,0);
rect (140, 250, 120, 30);
}
and yes you can use variables like x and y and squarewidth. that makes it probably easier to change the things, i just hardcoded it for now