package moreClasses;

import processing.core.PApplet;

public class Face
{
    private PApplet parent;
    private int centerX, centerY;
    private Eye leftEye, rightEye;

    public Face(PApplet p, int cX, int cY)
    {
        parent = p;
        centerX = cX;
        centerY = cY;
        leftEye = new Eye(parent, centerX - 100, centerY - 100);
        rightEye = new Eye(parent, centerX + 100, centerY - 100);
    }

    public void drawSelf()
    {
        parent.fill(0, 155, 255);
        parent.ellipse(centerX, centerY, 450, 450);

        leftEye.drawSelf();
        rightEye.drawSelf();

        parent.fill(255);
        parent.arc(centerX, centerY + 100, 150, 100, PApplet.radians(0), PApplet.radians(180));
    }
    
    public void handleMousePress()
    {
        if(leftEye.isInside(parent.mouseX, parent.mouseY))
            leftEye.close();
        else if(rightEye.isInside(parent.mouseX, parent.mouseY))
            rightEye.close();
    }
}
