package  
{
	import flash.display.Sprite;
	import flash.geom.Point;
	
	/**
	 * ...
	 * @author beisik
	 */
	public class Blood extends Sprite 
	{
		public var radius: Number;
		public var a: Number;
		public var velocity: Point;
		public var s: Number;
		
		public function Blood(x: Number, y: Number) 
		{
			this.x = x;
			this.y = y;
			
			velocity = new Point(Math.random() * 2 - 1, Math.random() * 2 - 1);
			velocity.x *= 50;
			velocity.y *= 50;
			
			radius = Snake.radius;
			a = 0.8;
			s = 3;
			Render();
		}
		
		public function Update(dt: Number): Boolean
		{
			if (radius <= 0)
				return false;
			//x += velocity.x * dt;
			//y += velocity.y * dt;
			//velocity.x = Global.Aspire(velocity.x, 0, Math.abs(velocity.x) * dt);
			//velocity.y = Global.Aspire(velocity.y, 0, Math.abs(velocity.y) * dt);
			//a -= dt * 0.1;
			radius += dt * s;
			s -= 0.01;
			//if (a <= 0)
				//return true;
			Render();
			return false;
		}
		
		public function Render(): void
		{
			graphics.clear();
			graphics.beginFill(0xC32435, a);
			graphics.drawCircle(0, 0, radius);
			graphics.endFill();
		}
		
	}

}