/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package game;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

/**
 *
 * @author A KUMA
 */
class shooter{
    private static  int x,y,xt[]=new int[4],yt[]=new int[4];
    int ancho=50,alto=20;
    shooter(int unX,int unY){
        x=unX;
        y=unY;
    Canon();
    }
    public void Canon(){
        xt[0]=x+(3*ancho/10);
        xt[1]=x+(4*ancho/10);
        xt[2]=x+(6*ancho/10);
        xt[3]=x+(7*ancho/10);//cordenadas relativas canon..
        yt[0] =y; 
        yt[1] =y-10;
        yt[2] =y-10;
        yt[3] =y;
    }
    public int getX(){return x;}
    public int getY(){return y;}
    public int getXB(){return xt[1]-2+(xt[2]-xt[1])/2;}
    public int getYB(){return yt[1];}
    public Rectangle getRectangleBase(){
        return new Rectangle(x,y,ancho,alto );
    }
    public Rectangle getRectangleCanon(){
        return new Rectangle(xt[0],y+10,xt[3]-xt[0],10);
    }
    public void setX(int newx){x=newx;}
    public void setY(int newy){x=newy;}
    public void dibuja(Graphics g){
        Canon();
        g.setColor(Color.green);//color del shot
        g.fillRect( x,y,ancho,alto );//base
        g.fillPolygon(xt,yt,4);//canon..xD
    }
}
