var lightGoon = { components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 0.5,
			scaleY: 0.5,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			alpha: 0.7
		}
	},
]};

var lightMedium = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
		}
	},
]};


var lightMediumCircuit = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.03,
			values: [0.05, 0.5, 0.05, 0.5, 0.05, 1.0],
			repeat: false
		}
	},
	{
		c: CircuitComponent,
		d: {
			toggleComponents: ["TweenerComponent", "SpriteComponent"],
			onSpawnDefinition: "buzzEffect",
		},
	},
]};

var flashlightCone = { components: [
	{
		c: TransformComponent,
		d: {
			y: 1.5
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestCar",
		}
	},
]};

var copFlashlightCone = { components: [
	{
		c: TransformComponent,
		d: {
			y: 2,
			scaleX: 1.5,
			scaleY: 1.7,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightCopFlashlight",
		}
	},
]};

var lightMediumCutoff = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightMediumCutoff",
		}
	},
]};

var lightMediumOutside = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xbcc7ff
		}
	},
]};

var lightMediumAlley = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xffec9f
		}
	},
]};

var lightMediumAlleyFlicker = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xffec9f
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.015,
			values: [0.05, 1.0, 0.05, 1.0, 0.98, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.97, 1.0, 0.05, 1.0, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 1.0, 0.05, 1.0, 0.98, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.97, 1.0, 0.05, 1.0, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
			repeat: true
		}
	}
]};

var satanLight = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xff2323
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.02,
			values: [1.0, 0.99, 1.0, 0.99, 1.0, 0.99, 1.0, 0.99,],
			repeat: true
		}
	}
]};

var lightMediumAlleyCircuitTest = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xffec9f,
			alpha: 0.0,
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.1,
			values: [0.05, 1.0, 0.05, 1.0, 0.05, 1.0],
			repeat: false
		}
	},
	{
		c: CircuitComponent,
		d: {
			toggleComponents: ["TweenerComponent", "SpriteComponent"],
			onSpawnDefinition: "buzzEffect"
		}
	},
]};

var hellHider = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "cube",
			name: "cube",
			defaultAnimationName: "default",
			tint: 0x000000
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.5,
			values: [1.0, 0],
			repeat: true
		}
	},
	{
		c: CircuitComponent,
		d: {
			toggleComponents: ["TweenerComponent"],
		}
	},
]};

var lightDarkAlley = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0x857754
		}
	},
]};

var lightMediumWarm = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xd9beb4
		}
	},
]};

var lightMediumPurplish = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xd180bd
		}
	},
]};

var lightMediumReddish = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xba6866
		}
	},
]};

var lightMediumBrownish = { components: [
	{
		c: TransformComponent
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0x9e6447
		}
	},
]};

var lightSafeRoom = { extend: lightMedium, components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 2.5,
			scaleY: 2.5,
		}
	},
	{
		c: SpriteComponent,
		d: {
			tint: 0x91a8ff
		}
	},
]};

var lightSmallBlue = { extend: lightMedium, components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 1,
			scaleY: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			tint: 0x91a8ff,
			alpha: 0.5,
		}
	},
]};

var lightBig = { extend: lightMedium, components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 2,
			scaleY: 2,
		}
	},
]};

var lightHuge = { extend: lightMedium, components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 4,
			scaleY: 4,
		}
	},
]};

var lightTelevision = { extend: lightMedium, components: [
	{
		c: SpriteComponent,
		d: {
			tint: 0x8b93ff
		}
	},
	{
		c: TransformComponent,
		d: {
			x: 0.66,
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.2,
			values: [0.95, 1.0, 0.9, 0.87, 0.9, 1.0],
			repeat: true
		}
	}
]};

var headlightsYellow = { tag: "powered", extend: lightBig, components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 2,
			scaleY: 2
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "cars",
			name: "car-dodgyVan-light",
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.04,
			values: [0, 0.5, 0, 0.3, 0, 0.6, 0, 0.4, 0, 1],
			repeat: false
		}
	}
]};

var headlightsYellowAtmosphere = { tag: "powered", extend: lightBig, components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 2,
			scaleY: 2
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "cars",
			name: "car-dodgyVan-light",
			alpha: 0.1
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.04,
			values: [0, 0.05, 0, 0.03, 0, 0.06, 0, 0.04, 0, 0.1],
			repeat: false
		}
	}
]};

var lightCarPoliceBlue = { extend: lightBig, components: [
	{
		c: SpriteComponent,
		d: {
			tint: 0x4444ff
		}
	},
	{
		c: TransformComponent,
		d: {
			x: 0.66,
			y: -0.2
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.2,
			values: [1.0, 0.0, 1.0],
			repeat: true
		}
	}
]};

var lightCarPoliceRed = { extend: lightBig, components: [
	{
		c: SpriteComponent,
		d: {
			tint: 0xff4444
		}
	},
	{
		c: TransformComponent,
		d: {
			x: -0.66,
			y: -0.2
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.2,
			values: [0.0, 1.0, 0.0],
			repeat: true
		}
	}
]};

var lightCarPoliceRedBulb = { extend: lightMedium, components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "cars",
			name: "carVigilantLights",
			defaultAnimationName: "staticRed"
		}
	},
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.2,
			values: [0.0, 1.0, 0.0],
			repeat: true
		}
	}
]};

var lightCarPoliceBlueBulb = { extend: lightMedium, components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "cars",
			name: "carVigilantLights",
			defaultAnimationName: "staticBlue"
		}
	},
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.2,
			values: [1.0, 0.0, 1.0],
			repeat: true
		}
	}
]};

var carVigilantLights = { components: [
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OBJECTS,
			sheet: "cars",
			name: "carVigilantLights",
			defaultAnimationName: "idle"
		}
	},
	{
		c: TransformComponent
	},
]};

var wallLightSquareDestroyed = { components: [
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_OVERHEAD,
			sheet: "tiles",
			name: "wallLightSquare",
			defaultAnimationName: "broken",
		}
	},
]};

var dockLightFlicker = { components: [
	{
		c: TransformComponent,
		d: {
			scaleX: 1,
			scaleY: 1,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightTestMedium",
			tint: 0xb55323
		}
	},
	{
		c: TweenerComponent,
		d: {
			component: "SpriteComponent",
			field: "alpha",
			duration: 0.2,
			values: [1.0, 0.98, 1.0],
			repeat: true
		}
	}
]};

var dockLight = { components: [
	{
		c: TransformComponent
	},
], children: [
	dockLightFlicker
]};

var spotLightCone = { components: [
	{
		c: TransformComponent,
		d: {
			y: 3.5,
			scaleX: 2,
			scaleY: 2.5,
		}
	},
	{
		c: SpriteComponent,
		d: {
			layer: LayerDefinitions.LAYER_LIGHTING,
			sheet: "lights",
			name: "lightCopFlashlight",
			tint: 0x2f53b2,
		}
	},
]};

var spotLight = { components: [
	{
		c: TransformComponent
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 0.5,
			maxHealth: 0.5,
			spawnOnDamage: {
				base: ["fxHitElectric"],
			}
		}
	},
	{
		c: ActionableComponent,
		d: {
			actionDefinitions: [ActionDefinitions.shoot],
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.1 * 1,
			collisionGroup: CollisionCategoryDefinitions.CC_CHARACTERS,
			collidesWith: [CollisionCategoryDefinitions.CC_BULLETS],
			senses: [CollisionCategoryDefinitions.CC_MOUSE, CollisionCategoryDefinitions.CC_HOTSPOTS, CollisionCategoryDefinitions.CC_PLANNING_TARGET]
		}
	},
	{
		c: FieldOfViewMarkerComponent,
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: true,
			density: 1,

		}
	},
], children: [
	spotLightCone
]};

var wallLightSquare = { components: [
	{
		c: TransformComponent,
		d: {
		}
	},
	{
		c: HealthComponent,
		d: {
			currentHealth: 0.5,
			maxHealth: 0.5,
			spawnOnDamage: {
				base: ["fxHitElectric"],
			},
			spawnAsBody: {
				base: ["wallLightSquareDestroyed"],
			},
		}
	},
	{
		c: ColliderComponent,
		d: {
			radius: 0.1 * 1,
			collisionGroup: CollisionCategoryDefinitions.CC_CHARACTERS,
			collidesWith: [CollisionCategoryDefinitions.CC_BULLETS],
			senses: [CollisionCategoryDefinitions.CC_MOUSE, CollisionCategoryDefinitions.CC_HOTSPOTS, CollisionCategoryDefinitions.CC_PLANNING_TARGET]
		}
	},
	{
		c: RigidBodyComponent,
		d: {
			isDynamic: false,
			density: 1,
		}
	},
], children: [
	{ components: [
		{
			c: TransformComponent,
			d: {
			}
		},
		{
			c: SpriteComponent,
			d: {
				layer: LayerDefinitions.LAYER_LIGHTING,
				sheet: "tiles",
				name: "wallLightSquare",
				defaultAnimationName: "default",
			}
		},
	]},
	{ components: [
		{
			c: TransformComponent,
			d: {
				y: 28 / 128,
				scaleX: 0.5,
				scaleY: 0.5,
			}
		},
		{
			c: SpriteComponent,
			d: {
				layer: LayerDefinitions.LAYER_LIGHTING,
				sheet: "lights",
				name: "lightHalf",
				tint: 0x8c7559,
			}
		},
	]}
]};