package enemies 
{
	import engine.Utils;
	import flash.filters.BlurFilter;
	import flash.filters.ColorMatrixFilter;
	/**
	 * ...
	 * @author Fiodar Paulavets
	 */
	public class EnemyPepelaz extends Enemy 
	{
		private var angle: Number;
		
		public function EnemyPepelaz() 
		{
			super(PepelazClip, 56);
			
			x = Game.screenWidth + _clip.width;
			y = 50 + (Game.screenHeight - 230) * Math.random();
			
			_velocity.x = -1;
			_speed = 90;
			
			life = 4;
			radius = 28;
			
			if (Math.random() > 0.5)
				angle = 20;
			else
				angle = -20;
			rotation = 20 * (1 - Math.random() * 2);
		}
		
		override public function Update(dt:Number):void 
		{
			rotation = Utils.AspireDegrees(rotation, angle, Math.abs(angle) * 2 * dt);
			if (rotation == angle)
				angle *= -1;
			
			super.Update(dt);
		}
		
	}

}