package  
{
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Spritemap;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;
	import net.flashpunk.FP;
	import net.flashpunk.Sfx;
	public class Projectile extends Entity
	{
		
		public var damage:Number = 0;
		public var killonhit:Boolean = true;
		
		[Embed(source = 'gfx/boom.mp3')]
		private const SND13:Class;
		public var boom:Sfx = new Sfx(SND13);
		
		public function kill():void
		{
			var e:Enemy = (collide("enemy", x, y) as Enemy);
			if (e)
			{
				Bazaar.emit("blood", 1,x,y);
				trace(e.hp);
				boom.play();
				e.hp -= damage;
				if (e.hp <= 0) 
				{
					FP.world.remove(e);
					
				}
			}
		}
		
		override public function removed():void
		{
			Bazaar.emit("boom", 1,x,y);
		}
		

		
	}
}