float leftEyeX, leftEyeY; float leftPupilX, leftPupilY; float rightEyeX, rightEyeY; float rightPupilX, rightPupilY; void setup() { size(800, 400); leftEyeX = width * 0.25; leftEyeY = height * 0.5; rightEyeX = width * 0.75; rightEyeY = height * 0.5; } void draw() { background(200); if (mouseX > 0 && mouseY > 0 && mouseX < width && mouseY < height) { // --- LEFT PUPIL --- float a = leftEyeX - 40; float b = leftEyeX + 40; float c = leftEyeY - 40; float d = leftEyeY + 40; leftPupilX = map(mouseX, 0, 800, a, b); leftPupilY = map(mouseY, 0, 400, c, d); // --- RIGHT PUPIL --- a = rightEyeX - 40; b = rightEyeX + 40; c = rightEyeY - 40; d = rightEyeY + 40; rightPupilX = map(mouseX, 0, 800, a, b); rightPupilY = map(mouseY, 0, 400, c, d); } // --- DRAW EYEBALLS --- fill(255); ellipse(leftEyeX, leftEyeY, 200, 200); ellipse(rightEyeX, rightEyeY, 200, 200); // --- DRAW PUPILS --- fill(0); ellipse(leftPupilX, leftPupilY, 80, 80); ellipse(rightPupilX, rightPupilY, 80, 80); }