// Handles Lighting.
// Worthless Bums 2012.


function createWallLightSource (%xIndex, %yIndex)
{//echo("createWallLightSource()");
	%lightSource = new Sprite("Light Source")
	{
		SceneLayer = $LightConeLayer;
		position = "-4000 -4000";
		scenegraph = levelSceneGraph;
		Animation = "Sprites:LightCone";
		visible = true;
		size = "12 12";
		xIndex = %xIndex;
		yIndex = %yIndex;
	};
	addObjectToScene(%lightSource);
	return %lightSource;
}
function flickerLight (%light)
{//echo("flickerLight()");
	(%light.lightSource).setVisible(0);
	(%light.lightSource).schedule(100, "setVisible", 1);
}