package  
{
			import net.flashpunk.FP;	
	import net.flashpunk.Entity;
	import net.flashpunk.utils.Draw;
	import net.flashpunk.graphics.Image;
		import net.flashpunk.Mask;
	import net.flashpunk.masks.Pixelmask;
	/**
	 * ...
	 * @author AntoineGuerchais
	 */
	public class Level1 extends Light
	{
					
	[Embed(source = '../assets/levels/level1.png')]
	private const LevelLight:Class;
	
		public function Level1() 
		{			
			layer = -1000;
			light = new Image(LevelLight);
			var pMask:Pixelmask;
			mask = pMask = new Pixelmask(LevelLight);
			graphic = light;
			light.blend = "add";
			light.alpha = 0.6;
		}
		
		override public function update():void 
		{
			var branchList:Array = [];
		    FP.world.getClass(Branch, branchList);
			branchInLight = 0;
			for each (var e:Branch in branchList) {
				if (mask.collide(e.mask) && e.childs.length == 0) {
					branchInLight++;
					e.inLight = true;
				}
				else
				{
					e.inLight = false;
				}
			}
		}
		
	}

}