package bullithell.objects.missiles;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RadialGradientPaint;
import java.awt.Rectangle;

public class Ball extends Missile{
	private Color color;
	private boolean returned;
	
	public Ball(int x, int y, Color color, double xspeed, double yspeed){
		setBorder(new Rectangle(x, y, 25,25));
		this.color = color;
		setXspeed(xspeed);
		setYspeed(yspeed);
		type = Missile.Missiletype.BALL;
	}
	public void draw(Graphics2D g2){
		g2.setPaint(new RadialGradientPaint(new Point((int)(getBorder().getX() + getBorder().getWidth()/2),(int)(getBorder().getY() + getBorder().getHeight()/2)), (int)(getBorder().getHeight()), new float[]{0.0f,0.3f,0.5f,1f}, new Color[]{color,new Color(0,0,0,0),color,new Color(0,0,0,0) }));
		g2.fillOval((int)getBorder().getX(), (int)getBorder().getY(), (int)getBorder().getWidth(), (int)getBorder().getHeight());
		super.draw(g2);
	}
	public void recalculate(){
		super.recalculate();
	}
	public boolean isReturned() {
		return returned;
	}
	public void setReturned(boolean returned) {
		this.returned = returned;
	}
	
}
