/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gamegraphics.elements;


import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
/**
 *
 * @author Ani
 */
public class Figure{
    private RenderingHints rh;
    private int coorX;
    private int coorY;


    public Figure() {
        rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING,
		RenderingHints.VALUE_ANTIALIAS_ON);

    }

    public void paint(Graphics g, int x, int y){
        this.coorX = x;
        this.coorY = y;
        update(g, x, y);
    }

    public void update(Graphics g, int x, int y) {
        drawFigure(g, x, y);
    }
    
    private void drawFigure(Graphics g, int x, int y){
        Graphics2D newG = (Graphics2D) g.create(x, y, 20, 27);
	newG.setRenderingHints(rh);

        for (int i=19; i>-1; i-=2){
            newG.setColor(new Color(90-i, 0, 40));
            newG.fillOval(10-i/2, 17-(i+7)/2, i, i/2+7);
        }

        newG.setColor(Color.WHITE);
        newG.fillOval(3, 8, 6, 6);
        newG.fillOval(12, 8, 6, 6);
        newG.setColor(Color.BLACK);
        newG.fillOval(5, 10, 3, 3);
        newG.fillOval(14, 10, 3, 3);

    }

    public int getCoorX() {
        return coorX;
    }

    public int getCoorY(){
        return coorY;
    }

    public void setCoorX(int coorX) {
        this.coorX = coorX;
    }

    public void setCoorY(int coorY) {
        this.coorY = coorY;
    }

}
