package bullithell.particles;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;

public class Fireball {
	private double x,y, mp;
	public Color color;

	public Fireball(int startx, int starty, int middlepoint)
	{
		x = startx;
		y = starty;
		mp = middlepoint;
		color = Color.white;
	}
	
	public void update()
	{
		y += 1;
		if(x < mp){
			x -= 1 -Math.random()*-10;
		}else{
			x += 1 + Math.random()*10;
		}
		color = new Color(255,color.getGreen(),color.getBlue()-40);
	}
	
	public void draw(Graphics g)
	{
		Graphics2D g2 = (Graphics2D)g;
		g2.setColor(color);
		Ellipse2D.Double ellipse = new Ellipse2D.Double(x,y,5,5);
		g2.fill(ellipse);
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
	
	
}
