package game.GameMain.LevelTiles
{
	import flash.display.Bitmap;
	import flinjin.Flinjin;
	import flinjin.graphics.Sprite;
	import game.GameMain.LevelScroll;
	import game.GameMain.Mobs.MantisMob;
	import game.GameMain.TileLevel;
	
	/**
	 * ...
	 * @author Michael Miriti
	 */
	public class Tile3 extends LevelTile
	{
		[Embed(source="../../../assets/level-tiles/3_lvl.png")]
		private static var _backBmp:Class;
		
		[Embed(source="../../../assets/level-tiles/3_mask.png")]
		private static var _mask:Class;
		
		private var _mantisMob:MantisMob;
		
		override public function Dispose():void
		{
			if (_mantisMob != null)
			{
				(_parentSprite.parent as TileLevel).PlayerLayer.deleteSprite(_mantisMob);
			}
			(_parentSprite as LevelScroll).addRandomTile();
			super.Dispose();
		}
		
		override public function InitMobs():void
		{
			if (_parentSprite.parent != null)
			{
				if (!_flipHorizontal)
				{
					_mantisMob = new MantisMob();
					(_parentSprite.parent as TileLevel).PlayerLayer.addSprite(_mantisMob, x + 325, y + 425);
				}
			}
		}
		
		public function Tile3()
		{
			super(Flinjin.sceneWidth, Flinjin.sceneHeight);
			Bmp = new Sprite(new _backBmp() as Bitmap);
			
			addSprite(Bmp);
			
			Mask = (new _mask() as Bitmap).bitmapData;
		}
	
	}

}