package  
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author beisik
	 */
	public class Shadow extends Sprite 
	{
		[Embed(source = 'textures/sh.png')] private const SAW: Class;
		
		private var distance: Number;
		
		public function Shadow(shadow: uint = 0) 
		{
			switch (shadow)
			{
				case 0: // змейка
					distance = 12;
					graphics.beginFill(0x5B8212, 0.8);
					graphics.drawEllipse(-18, -15, 36, 30);
					graphics.endFill();
					break;
				case 1: // яблоко
					distance = 17;
					graphics.beginFill(0x5B8212, 0.8);
					graphics.drawEllipse(-29, -17, 58, 34);
					graphics.endFill();
					break;
				case 2: // пила
					distance = 10;
					var img: Bitmap = new SAW();
					img.x = -30;
					img.y = -90;
					img.alpha = 0.8;
					addChild(img);
					break;
				case 3: // камень
					distance = 20;
					graphics.beginFill(0x5B8212, 0.8);
					graphics.drawEllipse(-45, -30, 90, 60);
					graphics.endFill();
					break;
				case 4: // цветок
					distance = 15;
					graphics.beginFill(0x5B8212, 0.8);
					graphics.drawEllipse(-10, -5, 20, 10);
					graphics.endFill();
					break;
			}
		}
		
		public function move(x: Number, y: Number): void
		{
			this.x = x;
			this.y = y + distance;
		}
		
	}

}