dofile('data/Scripts/Scenes/Common.lua');
dofile('data/Scripts/Scenes/Animations/14_TempleEntrance_Animations.lua');

------------------------------------------------------------------------------
--
function OnSceneLoad(restoringFromSave)
	InitGameState();

	play_field = playField;
    LoadData();
	play_field = nil;

    RootZoomZone = CreateZoomZone('RootZoomZone', nil, 
                                   nil, 0.0, 
                                   nil, 0.0,
							{'RootBackground',

							 'archer',
							 'axe2',
							 'axe3',
							 'axe',
							 'basil',
							 'basket2',
							 'basket',
							 'cat',
							 'catStatuette',
							 'dragon',
							 'duck',
							 'fangNecklace',
							 'feather',
							 'feathers',
							 'fish',
							 'fishes',
							 'flower1',
							 'flower2',
							 'flower3',
							 'frog',
							 'hare',
							 'horse',
							 'hunter',
							 'knife',
							 'lash',
							 'lettuce',
							 'lion',
							 'mask2',
							 'mask',
							 'moccasins',
							 'palmPrint',
							 'pattern1',
							 'pattern2',
							 'pattern3',
							 'plant',
							 'pot',
							 'pumpkin',
							 'skull',
							 'spear',
							 'statuette',

							 'columnLeft',
							 'columnRight',
							 'doorLock2',
							 'doorLockPinion',
							 'doorMuzzleClosed',
							 'doorMuzzleOpened',
							 'innerDoorBL',
							 'innerDoorBR',
							 'innerDoorTL',
							 'innerDoorTR',

							 'LaverOverLeftTorch',
							 'LayerOverAxe',
							 'LayerOverColumnLeft',
							 'LayerOverColumnRight',
							 'LayerOverDoor',
							 'LayerOverDuck',
							 'LayerOverHare',
							 'LayerOverKnife',
							 'LayerOverLion',
							 'LayerOverMask2',
							 'LayerOverPumpkin',
							 'LayerOverRightTorch',
							 'layerOverMedallion',
							 'LayerOverLeftCup',
							 'LayerOverRightCup',

							 'muzzleLeftOpened',
							 'actZoneMuzzleLeft',
							 'muzzleRightOpened',
							 'actZoneMuzzleRight',
							 'outerDoorBL',
							 'outerDoorBR',
							 'outerDoorTL',
							 'outerDoorTR',

							 'actZoneDiamond',
							 'actZoneEmerald',
							 'actZoneRuby',	
							 'actZoneLeftKey',
							 'actZoneRightKey',

							 'Diamond',
							 'Emerald',
							 'LeftKey',
							 'Medallion',
							 'RightKey',
							 'Ruby',

							 'Diamond_onPlace',
							 'Emerald_onPlace',
							 'LeftKey_onPlace',
							 'Medallion_onPlace',
							 'RightKey_onPlace',
							 'Ruby_onPlace'},

							{'Diamond_onPlace',
							 'Emerald_onPlace',
							 'LeftKey_onPlace',
							 'Medallion_onPlace',
							 'RightKey_onPlace',
							 'Ruby_onPlace'},

							{'gobletFlameLeft',
							 'gobletFlameRight',
							 'gobletFlameLeftGlow',
							 'gobletFlameRightGlow',
							 'torchFlameLeft',
							 'torchFlameRight',
							 'torchFlameLeftGlow',
							 'torchFlameRightGlow',
							 'emeraldGlow',
							 'rubyGlow',
							 'diamondGlow'
                             });

if (restoringFromSave == false) then
    AddRandomTasks(true, MISC_TASK_COUNT_24,
		CreateTask('archer'),
		CreateTask('axe2'),
		CreateTask('axe3'),
		CreateTask('axe'),
		CreateTask('basil'),
		CreateTask('basket2'),
		CreateTask('basket'),
		CreateTask('cat'),
		CreateTask('catStatuette'),
		CreateTask('dragon'),
		CreateTask('duck'),
		CreateTask('fangNecklace'),
		CreateTask('feather'),
		CreateTask('feathers'),
		CreateTask('fish'),
		CreateTask('fishes'),
		CreateTask('flower1'),
		CreateTask('flower2'),
		CreateTask('flower3'),
		CreateTask('frog'),
		CreateTask('hare'),
		CreateTask('horse'),
		CreateTask('hunter'),
		CreateTask('knife'),
		CreateTask('lash'),
		CreateTask('lettuce'),
		CreateTask('lion'),
		CreateTask('mask2'),
		CreateTask('mask'),
		CreateTask('moccasins'),
		CreateTask('palmPrint'),
		CreateTask('pattern1'),
		CreateTask('pattern2'),
		CreateTask('pattern3'),
		CreateTask('plant'),
		CreateTask('pot'),
		CreateTask('pumpkin'),
		CreateTask('skull'),
		CreateTask('spear'),
		CreateTask('statuette')
	);

    playField:GetLevelScreen():AddTaskSafe(CreateTask('Medallion'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Diamond'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Emerald'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Ruby'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('LeftKey'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('RightKey'));
end

	CreateToolMap(	{'Medallion', 	'actZoneDiamond'},
					{'Diamond',   	'actZoneDiamond'},
					{'Emerald',		'actZoneEmerald'},
					{'Ruby',   		'actZoneRuby'},
					{'LeftKey',  	'actZoneLeftKey'},
					{'RightKey',	'actZoneRightKey'});

	SetIconForGameObject(playField:GetObject('archer'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/archer_icon.png');
	SetIconForGameObject(playField:GetObject('axe2'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/axe2_icon.png');
	SetIconForGameObject(playField:GetObject('axe3'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/axe3_icon.png');
	SetIconForGameObject(playField:GetObject('axe'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/axe_icon.png');
	SetIconForGameObject(playField:GetObject('basil'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/basil_icon.png');
	SetIconForGameObject(playField:GetObject('basket2'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/basket2_icon.png');
	SetIconForGameObject(playField:GetObject('basket'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/basket_icon.png');
	SetIconForGameObject(playField:GetObject('cat'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/cat_icon.png');
	SetIconForGameObject(playField:GetObject('catStatuette'),'data/Texture/Scenes/14_TempleEntrance/Items/Misc/catStatuette_icon.png');
	SetIconForGameObject(playField:GetObject('dragon'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/dragon_icon.png');
	SetIconForGameObject(playField:GetObject('duck'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/duck_icon.png');
	SetIconForGameObject(playField:GetObject('fangNecklace'),'data/Texture/Scenes/14_TempleEntrance/Items/Misc/fangNecklace_icon.png');
	SetIconForGameObject(playField:GetObject('feather'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/feather_icon.png');
	SetIconForGameObject(playField:GetObject('feathers'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/feathers_icon.png');
	SetIconForGameObject(playField:GetObject('fish'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/fish_icon.png');
	SetIconForGameObject(playField:GetObject('fishes'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/fishes_icon.png');
	SetIconForGameObject(playField:GetObject('flower1'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/flower1_icon.png');
	SetIconForGameObject(playField:GetObject('flower2'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/flower2_icon.png');
	SetIconForGameObject(playField:GetObject('flower3'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/flower3_icon.png');
	SetIconForGameObject(playField:GetObject('frog'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/frog_icon.png');
	SetIconForGameObject(playField:GetObject('hare'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/hare_icon.png');
	SetIconForGameObject(playField:GetObject('horse'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/horse_icon.png');
	SetIconForGameObject(playField:GetObject('hunter'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/hunter_icon.png');
	SetIconForGameObject(playField:GetObject('knife'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/knife_icon.png');
	SetIconForGameObject(playField:GetObject('lash'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/lash_icon.png');
	SetIconForGameObject(playField:GetObject('lettuce'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/lettuce_icon.png');
	SetIconForGameObject(playField:GetObject('lion'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/lion_icon.png');
	SetIconForGameObject(playField:GetObject('mask2'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/mask2_icon.png');
	SetIconForGameObject(playField:GetObject('mask'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/mask_icon.png');
	SetIconForGameObject(playField:GetObject('moccasins'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/moccasins_icon.png');
	SetIconForGameObject(playField:GetObject('palmPrint'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/palmPrint_icon.png');
	SetIconForGameObject(playField:GetObject('pattern1'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/pattern1_icon.png');
	SetIconForGameObject(playField:GetObject('pattern2'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/pattern2_icon.png');
	SetIconForGameObject(playField:GetObject('pattern3'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/pattern3_icon.png');
	SetIconForGameObject(playField:GetObject('plant'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/plant_icon.png');
	SetIconForGameObject(playField:GetObject('pot'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/pot_icon.png');
	SetIconForGameObject(playField:GetObject('pumpkin'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/pumpkin_icon.png');
	SetIconForGameObject(playField:GetObject('skull'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/skull_icon.png');
	SetIconForGameObject(playField:GetObject('spear'),		'data/Texture/Scenes/14_TempleEntrance/Items/Misc/spear_icon.png');
	SetIconForGameObject(playField:GetObject('statuette'),	'data/Texture/Scenes/14_TempleEntrance/Items/Misc/statuette_icon.png');

	SetIconForGameObject(playField:GetObject('Medallion'),	'data/Texture/Scenes/14_TempleEntrance/Items/Medallion_icon.png');
	SetIconForGameObject(playField:GetObject('Diamond'),	'data/Texture/Scenes/14_TempleEntrance/Items/Diamond_icon.png');
	SetIconForGameObject(playField:GetObject('Emerald'),	'data/Texture/Scenes/14_TempleEntrance/Items/Emerald_icon.png');
	SetIconForGameObject(playField:GetObject('Ruby'),		'data/Texture/Scenes/14_TempleEntrance/Items/Ruby_icon.png');
	SetIconForGameObject(playField:GetObject('LeftKey'),	'data/Texture/Scenes/14_TempleEntrance/Items/LeftKey_icon.png');
	SetIconForGameObject(playField:GetObject('RightKey'),	'data/Texture/Scenes/14_TempleEntrance/Items/RightKey_icon.png');

if (restoringFromSave == false) then
	gameState.medallionOnPlace = false;
	gameState.diamondOnPlace = false;
	gameState.emeraldOnPlace = false;
	gameState.rubyOnPlace = false;
	gameState.leftKeyOnPlace = false;
	gameState.rightKeyOnPlace = false;

	gameState.leftPlatformIsMoving = false;
	gameState.rightPlatformIsMoving = false;
	gameState.diamondIsFalling = false;
	gameState.stateGatesAreOpening = false;

	gameState.allToolsApplied = false;
	gameState.levelCompleted = false;
end

	AssignActiveZonesGlow({function() return gameState.medallionOnPlace; end,		'actZoneDiamond',	'Medallion_ghost'},
						  {function() return gameState.diamondOnPlace or
											 not gameState.medallionOnPlace; end,	'actZoneDiamond',	'Diamond_ghost'},
					      {function() return gameState.emeraldOnPlace; end,			'actZoneEmerald',	'Emerald_ghost'},
						  {function() return gameState.rubyOnPlace; end,			'actZoneRuby',		'Ruby_ghost'},
						  {function() return gameState.leftKeyOnPlace; end,			'actZoneLeftKey',	'LeftKey_ghost'},
						  {function() return gameState.rightKeyOnPlace; end,		'actZoneRightKey',	'RightKey_ghost'});

    ApplyLevelDump(restoringFromSave);
	SetZoneVisible(RootZoomZone, true, false);

	auxSceneInit(restoringFromSave);
	auxProcessToolObjectStateAnCursorType();
end

------------------------------------------------------------------------------
--
function OnSceneFree()
    FreeData()

    StopSound('L14S10');
    StopSound('L14S11');
    StopSound('L14S12');
    StopSound('L14S13');
    StopSound('L14S14');
    StopSound('L14S15');
    StopSound('L14S16');
end

--// Local auxiliary functions - - - - - - - - - - - - - - - - - - - - - - - -
function auxSceneInit(restoringFromSave)
    local initialActions = function()
		ShowLevelIntro(14);
    end
	local regularActions = function()
	    PlaySound('L14S14', true);
		if (gameState.leftKeyOnPlace) then
			StopSound('L14S15');
		else
		    PlaySound('L14S15', true);
		end
		if (gameState.rightKeyOnPlace) then
			StopSound('L14S16');
		else
		    PlaySound('L14S16', true);
		end

    	playField:IgnoreOnTestPoint('layerOverMedallion');

    	playField:IgnoreOnTestPoint('LaverOverLeftTorch');
    	playField:IgnoreOnTestPoint('LayerOverAxe');
    	playField:IgnoreOnTestPoint('LayerOverColumnLeft');
    	playField:IgnoreOnTestPoint('LayerOverColumnRight');
    	playField:IgnoreOnTestPoint('LayerOverDoor');
    	playField:IgnoreOnTestPoint('LayerOverDuck');
    	playField:IgnoreOnTestPoint('LayerOverHare');
    	playField:IgnoreOnTestPoint('LayerOverKnife');
    	playField:IgnoreOnTestPoint('LayerOverLion');
    	playField:IgnoreOnTestPoint('LayerOverMask2');
    	playField:IgnoreOnTestPoint('LayerOverPumpkin');
    	playField:IgnoreOnTestPoint('LayerOverRightTorch');
    	playField:IgnoreOnTestPoint('layerOverMedallion');
    	playField:IgnoreOnTestPoint('LayerOverLeftCup');
    	playField:IgnoreOnTestPoint('LayerOverRightCup');

    	playField:IgnoreOnTestPoint('gobletFlameLeft');
    	playField:IgnoreOnTestPoint('gobletFlameRight');
    	playField:IgnoreOnTestPoint('gobletFlameLeftGlow');
    	playField:IgnoreOnTestPoint('gobletFlameRightGlow');
    	auxSetFibrillationEffector(playField:GetObject('gobletFlameLeftGlow'), 0.14);
    	auxSetFibrillationEffector(playField:GetObject('gobletFlameRightGlow'), 0.15);
    	playField:IgnoreOnTestPoint('torchFlameLeft');
    	playField:IgnoreOnTestPoint('torchFlameRight');
    	playField:IgnoreOnTestPoint('torchFlameLeftGlow');
    	playField:IgnoreOnTestPoint('torchFlameRightGlow');
    	auxSetFibrillationEffector(playField:GetObject('torchFlameLeftGlow'), 0.17);
    	auxSetFibrillationEffector(playField:GetObject('torchFlameRightGlow'), 0.20);

    	playField:IgnoreOnTestPoint('emeraldGlow');
    	playField:IgnoreOnTestPoint('rubyGlow');
    	playField:IgnoreOnTestPoint('diamondGlow');

-- (!) BUG with attachment
--		auxAttachInPlace(playField:GetObject('gobletFlameLeftGlow'), playField:GetObject('gobletFlameLeft'));
--		auxAttachInPlace(playField:GetObject('gobletFlameRightGlow'), playField:GetObject('gobletFlameRight'));
		if (playField:HasObject('Ruby')) then
	    	auxAttachInPlace(playField:GetObject('Ruby'), playField:GetObject('columnLeft'));
		end
		if (playField:HasObject('Emerald')) then
	    	auxAttachInPlace(playField:GetObject('Emerald'), playField:GetObject('columnRight'));
		end
    	auxAttachInPlace(playField:GetObject('emeraldGlow'), playField:GetObject('Emerald_onPlace'));
    	auxAttachInPlace(playField:GetObject('rubyGlow'), playField:GetObject('Ruby_onPlace'));
    	auxAttachInPlace(playField:GetObject('diamondGlow'), playField:GetObject('Diamond_onPlace'));

    	auxAttachInPlace(playField:GetObject('Diamond_onPlace'), playField:GetObject('Medallion_onPlace'));
    	auxAttachInPlace(playField:GetObject('Medallion_onPlace'), playField:GetObject('doorLockPinion'));
    	auxAttachInPlace(playField:GetObject('doorLockPinion'), playField:GetObject('doorLock2'));
    	auxAttachInPlace(playField:GetObject('doorLock2'), playField:GetObject('innerDoorTR'), false);

    	auxInitGates();
    	auxInitColums();
		if (playField:HasObject('Diamond')) then
	    	gameState.diamondInitialPos = {playField:GetObject('Diamond'):GetX(), playField:GetObject('Diamond'):GetY()};
		end
    	gameState.diamondMovementDuration = 0.9;
    	gameState.diamondShift = {4.0, 310.0};
		if (gameState.stateGatesAreOpening == false and
			gameState.diamondOnPlace == true) then

			auxSetGatesPartsState(true);
		end


		auxCreateTempleEntranceAnimations(playField:GetObject('RootBackground'));
		auxPlayTempleEntranceAnimation('Dragonfly1');
		auxPlayTempleEntranceAnimation('EnvTop');
--		auxPlayTempleEntranceAnimation('Dragonfly2');

		gameState.nextAnimationDelay = 0;

		gameState.leftPlatformIsMoving = false;
		gameState.rightPlatformIsMoving = false;
		gameState.diamondIsFalling = false;
		gameState.stateGatesAreOpening = false;
	end

    if (restoringFromSave == false) then
        initialActions();
	else
    end	
    regularActions();

	if (gameState.levelCompleted == true) then
		gameState.levelCompleted = false;

		auxSetGatesPartsState(true);
		auxTestLevelCompleteCondition();
	end
end

function auxProcessToolObjectStateAnCursorType()
    assert(	gameState.medallionOnPlace ~= nil and
			gameState.diamondOnPlace ~= nil and
			gameState.emeraldOnPlace ~= nil and
			gameState.rubyOnPlace ~= nil and
			gameState.leftKeyOnPlace ~= nil and
			gameState.rightKeyOnPlace ~= nil and

			gameState.leftPlatformIsMoving ~= nil and
			gameState.rightPlatformIsMoving ~= nil);

	if (gameState.medallionOnPlace == true) then
		RootZoomZone.UnhideObject('Medallion_onPlace');
		RootZoomZone.UnhideObject('muzzleLeftOpened');
		if (playField:HasObject('LeftKey') == true) then
			RootZoomZone.UnhideObject('LeftKey');
		end
	else
		RootZoomZone.HideObject('Medallion_onPlace');
		RootZoomZone.HideObject('muzzleLeftOpened');
		if (playField:HasObject('LeftKey') == true) then
			RootZoomZone.HideObject('LeftKey');
		end
	end
	if (gameState.diamondOnPlace == true) then
		RootZoomZone.UnhideObject('Diamond_onPlace');
	else
		RootZoomZone.HideObject('Diamond_onPlace');
	end
	if (gameState.medallionOnPlace == true and gameState.diamondOnPlace == true) then
		gameState.customCursors['actZoneDiamond'] = nil;
	else
		gameState.customCursors['actZoneDiamond'] = {'CursorArms'};
	end

	if (gameState.leftKeyOnPlace == true) then
		RootZoomZone.UnhideObject('LeftKey_onPlace');
		auxUpdateLeftPlatformState(gameState.leftKeyOnPlace);
		playField:GetObject('gobletFlameLeft'):SetVisible(false);
		playField:GetObject('gobletFlameLeftGlow'):SetVisible(false);
		gameState.customCursors['actZoneLeftKey'] = nil;
	else
		RootZoomZone.HideObject('LeftKey_onPlace');
		auxUpdateLeftPlatformState(gameState.leftKeyOnPlace);
		playField:GetObject('gobletFlameLeft'):SetVisible(true);
		playField:GetObject('gobletFlameLeftGlow'):SetVisible(true);
		gameState.customCursors['actZoneLeftKey'] = {'CursorArms'};
	end

	if (gameState.rubyOnPlace == true) then
		RootZoomZone.UnhideObject('Ruby_onPlace');
		RootZoomZone.UnhideObject('muzzleRightOpened');
		if (playField:HasObject('RightKey') == true) then
			RootZoomZone.UnhideObject('RightKey');
		end
		gameState.customCursors['actZoneRuby'] = nil;
	else
		RootZoomZone.HideObject('Ruby_onPlace');
		RootZoomZone.HideObject('muzzleRightOpened');
		if (playField:HasObject('RightKey') == true) then
			RootZoomZone.HideObject('RightKey');
		end
		gameState.customCursors['actZoneRuby'] = {'CursorArms'};
	end

	if (gameState.rightKeyOnPlace == true) then
		RootZoomZone.UnhideObject('RightKey_onPlace');
		auxUpdateRightPlatformState(gameState.rightKeyOnPlace);
		playField:GetObject('gobletFlameRight'):SetVisible(false);
		playField:GetObject('gobletFlameRightGlow'):SetVisible(false);
		gameState.customCursors['actZoneRightKey'] = nil;
	else
		RootZoomZone.HideObject('RightKey_onPlace');
		auxUpdateRightPlatformState(gameState.rightKeyOnPlace);
		playField:GetObject('gobletFlameRight'):SetVisible(true);
		playField:GetObject('gobletFlameRightGlow'):SetVisible(true);
		gameState.customCursors['actZoneRightKey'] = {'CursorArms'};
	end

	if (gameState.emeraldOnPlace == true) then
		RootZoomZone.UnhideObject('Emerald_onPlace');
			gameState.customCursors['actZoneEmerald'] = nil;
	else
		RootZoomZone.HideObject('Emerald_onPlace');
			gameState.customCursors['actZoneEmerald'] = {'CursorArms'};
	end
	auxUpdateDiamondPosition(not gameState.emeraldOnPlace);
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxInitGates()
	gameState.gatesOpeningDuration 	= 5.0;
	gameState.gatesPartMoveDistance = 80.0;
	gameState.gateslockMoveDistance = -90.0;
	gameState.gateslockRotationAngle= 90.0 * M_PI/180.0;

	gameState.gatesOuterDoorTLInitPosX = playField:GetObject('outerDoorTL'):GetX();
	gameState.gatesOuterDoorTRInitPosX = playField:GetObject('outerDoorTR'):GetX();
	gameState.gatesOuterDoorBLInitPosX = playField:GetObject('outerDoorBL'):GetX();
	gameState.gatesOuterDoorBRInitPosX = playField:GetObject('outerDoorBR'):GetX();
	gameState.gatesInnerDoorTLInitPosX = playField:GetObject('innerDoorTL'):GetX();
	gameState.gatesInnerDoorTRInitPosX = playField:GetObject('innerDoorTR'):GetX();
	gameState.gatesInnerDoorBLInitPosX = playField:GetObject('innerDoorBL'):GetX();
	gameState.gatesInnerDoorBRInitPosX = playField:GetObject('innerDoorBR'):GetX();
	gameState.gatesLockInitPosY = playField:GetObject('doorLock2'):GetY();
end
function auxOpenGates()
	local duration 			= gameState.gatesOpeningDuration;
	local doorMoveDistance 	= gameState.gatesPartMoveDistance;
	local lockMoveDistance 	= gameState.gateslockMoveDistance;
	local lockRotationAngle = gameState.gateslockRotationAngle;

	local outerTopDoorsMoveDuration 	= 0.2*duration;
	local outerBottomDoorsMoveDelay 	= 0.1*duration;
	local outerBottomDoorsMoveDuration 	= 0.3*duration;

	local lockMovementDelay				= 0.4*duration;
	local lockMovementDuration			= 0.1*duration;
	local lockRotationDelay				= 0.2*duration;
	local lockRotationDuration			= 0.2*duration;

	local innerTopDoorsMoveDelay		= 0.6*duration;
	local innerTopDoorsMoveDuration		= outerTopDoorsMoveDuration;
	local innerBottomDoorsMoveDelay		= innerTopDoorsMoveDelay + outerBottomDoorsMoveDelay;
	local innerBottomDoorsMoveDuration	= outerBottomDoorsMoveDuration;

	auxSetGatesPartsState(false);

	gameState.stateGatesAreOpening = false;
	TimerDoString('SetGameStateParameter(\'stateGatesAreOpening\', false);', duration, playField:GetTimer());

	PlaySound('L14S13');
	playField:GetObject('outerDoorTL'):Move(-doorMoveDistance, 0.0, outerTopDoorsMoveDuration);
	playField:GetObject('outerDoorTR'):Move(doorMoveDistance, 0.0, outerTopDoorsMoveDuration);
	TimerDoString('playField:GetObject(\'outerDoorBL\'):Move('..tostring(-doorMoveDistance)..', 0.0, '..tostring(outerBottomDoorsMoveDuration)..');', outerBottomDoorsMoveDelay, playField:GetTimer());
	TimerDoString('playField:GetObject(\'outerDoorBR\'):Move('..tostring(doorMoveDistance)..', 0.0, '..tostring(outerBottomDoorsMoveDuration)..');', outerBottomDoorsMoveDelay, playField:GetTimer());

	TimerDoString('playField:GetObject(\'doorLock2\'):Move(0.0, '..tostring(lockMoveDistance)..', '..tostring(lockMovementDuration)..');', lockMovementDelay, playField:GetTimer());
	TimerDoString('playField:GetObject(\'doorLock2\'):Rotate('..tostring(lockRotationAngle)..', '..tostring(lockRotationDuration)..');', lockRotationDelay, playField:GetTimer());
	
	TimerDoString('playField:GetObject(\'innerDoorTL\'):Move('..tostring(-doorMoveDistance)..', 0.0, '..tostring(innerTopDoorsMoveDuration)..');', innerTopDoorsMoveDelay, playField:GetTimer());
	TimerDoString('playField:GetObject(\'innerDoorTR\'):Move('..tostring(doorMoveDistance)..', 0.0, '..tostring(innerTopDoorsMoveDuration)..');', innerTopDoorsMoveDelay, playField:GetTimer());
	TimerDoString('playField:GetObject(\'innerDoorBL\'):Move('..tostring(-doorMoveDistance)..', 0.0, '..tostring(innerBottomDoorsMoveDuration)..');', innerBottomDoorsMoveDelay, playField:GetTimer());
	TimerDoString('playField:GetObject(\'innerDoorBR\'):Move('..tostring(doorMoveDistance)..', 0.0, '..tostring(innerBottomDoorsMoveDuration)..');', innerBottomDoorsMoveDelay, playField:GetTimer());
end
function auxSetGatesPartsState(opened)
	playField:GetObject('outerDoorTL'):SetX(opened and gameState.gatesOuterDoorTLInitPosX - gameState.gatesPartMoveDistance or gameState.gatesOuterDoorTLInitPosX);
	playField:GetObject('outerDoorTR'):SetX(opened and gameState.gatesOuterDoorTRInitPosX + gameState.gatesPartMoveDistance or gameState.gatesOuterDoorTRInitPosX);
	playField:GetObject('outerDoorBL'):SetX(opened and gameState.gatesOuterDoorBLInitPosX - gameState.gatesPartMoveDistance or gameState.gatesOuterDoorBLInitPosX);
	playField:GetObject('outerDoorBR'):SetX(opened and gameState.gatesOuterDoorBRInitPosX + gameState.gatesPartMoveDistance or gameState.gatesOuterDoorBRInitPosX);
	playField:GetObject('innerDoorTL'):SetX(opened and gameState.gatesInnerDoorTLInitPosX - gameState.gatesPartMoveDistance or gameState.gatesInnerDoorTLInitPosX);
	playField:GetObject('innerDoorTR'):SetX(opened and gameState.gatesInnerDoorTRInitPosX + gameState.gatesPartMoveDistance or gameState.gatesInnerDoorTRInitPosX);
	playField:GetObject('innerDoorBL'):SetX(opened and gameState.gatesInnerDoorBLInitPosX - gameState.gatesPartMoveDistance or gameState.gatesInnerDoorBLInitPosX);
	playField:GetObject('innerDoorBR'):SetX(opened and gameState.gatesInnerDoorBRInitPosX + gameState.gatesPartMoveDistance or gameState.gatesInnerDoorBRInitPosX);
	playField:GetObject('doorLock2'):SetY(opened and gameState.gatesLockInitPosY + gameState.gateslockMoveDistance or gameState.gatesLockInitPosY);
	playField:GetObject('doorLock2'):SetAngle(opened and gameState.gateslockRotationAngle or 0.0);
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxInitColums()
	gameState.columnMovementDuration= 2.0;
	gameState.columnMoveDistance	= -50.0;
	gameState.leftColumnInitPosY	= playField:GetObject('columnLeft'):GetY();
	gameState.rightColumnInitPosY	= playField:GetObject('columnRight'):GetY();
end
function auxLiftLeftPlatform()
	local duration = 1.0;

    StopSound('L14S15');
	PlaySound('L14S11');
	gameState.leftPlatformIsMoving = true;
	TimerDoString('SetGameStateParameter(\'leftPlatformIsMoving\', false);', duration, playField:GetTimer());

	playField:GetObject('columnLeft'):SetY(gameState.leftColumnInitPosY);
	playField:GetObject('columnLeft'):Move(0.0, gameState.columnMoveDistance, duration);
end
function auxUpdateLeftPlatformState(lifted)
	if (gameState.leftPlatformIsMoving == false) then
		playField:GetObject('columnLeft'):SetY(lifted and gameState.leftColumnInitPosY + gameState.columnMoveDistance or gameState.leftColumnInitPosY);
	end
end
function auxLiftRightPlatform()
	local duration = 1.0;

    StopSound('L14S16');
	PlaySound('L14S11');
	gameState.rightPlatformIsMoving = true;
	TimerDoString('SetGameStateParameter(\'rightPlatformIsMoving\', false);', duration, playField:GetTimer());

	playField:GetObject('columnRight'):SetY(gameState.rightColumnInitPosY);
	playField:GetObject('columnRight'):Move(0.0, gameState.columnMoveDistance, duration);
end
function auxUpdateRightPlatformState(lifted)
	if (gameState.rightPlatformIsMoving == false) then
		playField:GetObject('columnRight'):SetY(lifted and gameState.rightColumnInitPosY + gameState.columnMoveDistance or gameState.rightColumnInitPosY);
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxDropDownDiamond()
	assert(playField:HasObject('Diamond') == true);

	local obj 		= playField:GetObject('Diamond');
	local objX 		= gameState.diamondInitialPos[1];
	local objY 		= gameState.diamondInitialPos[2];
	local duration 	= gameState.diamondMovementDuration;
	local fallHeight= gameState.diamondShift[2];

	PlaySound('L14S10');
	gameState.diamondIsFalling = true;
	TimerDoString('SetGameStateParameter(\'diamondIsFalling\', false);', duration, playField:GetTimer());

	eff = CreateAnimationEffector();
	eff:AttachTo(obj);

	eff:SetKey(_TRACK_X, 0.0, objX);
	eff:SetKey(_TRACK_Y, 0.0, objY);
	eff:SetKey(_TRACK_A, 0.0, 0.0);

	eff:SetKey(_TRACK_X, duration *4.0/8.0, objX);
	eff:SetKey(_TRACK_Y, duration *4.0/8.0, objY + fallHeight);

	eff:SetKey(_TRACK_X, duration *5.0/8.0, objX);
	eff:SetKey(_TRACK_Y, duration *5.0/8.0, objY + fallHeight - 3.0);

	eff:SetKey(_TRACK_X, duration *6.0/8.0, objX + 2.0);
	eff:SetKey(_TRACK_Y, duration *6.0/8.0, objY + fallHeight + 3.0);

	eff:SetKey(_TRACK_X, duration *7.0/8.0, objX + 2.0 + 1.0);
	eff:SetKey(_TRACK_Y, duration *7.0/8.0, objY + fallHeight + 3.0 - 1.0);

	eff:SetKey(_TRACK_X, duration *8.0/8.0, objX + 2.0 + 1.0 + 1.0);
	eff:SetKey(_TRACK_Y, duration *8.0/8.0, objY + fallHeight + 3.0 + 1.0);
	eff:SetKey(_TRACK_A, duration *8.0/8.0, 200.0 * M_PI/180.0);

	eff:Play();
end
function auxUpdateDiamondPosition(onInitPlace)
	if (gameState.diamondIsFalling == false and playField:HasObject('Diamond') == true) then
		if (onInitPlace == true) then
			playField:GetObject('Diamond'):SetXY(gameState.diamondInitialPos[1], gameState.diamondInitialPos[2]);
			playField:GetObject('Diamond'):SetAngle(0.0);
		else
			playField:GetObject('Diamond'):SetXY(gameState.diamondInitialPos[1] + gameState.diamondShift[1], 
												 gameState.diamondInitialPos[2] + gameState.diamondShift[2] + 4.0);
			playField:GetObject('Diamond'):SetAngle(200.0 * M_PI/180.0);
		end
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxUpdatePeriodicAnimations(dt)
	if (gameState.nextAnimationDelay == 0.0) then
		local animations = {};

		for compositionName, composition in pairs(templeEntranceCompositions) do
			if (composition:IsCyclic() == false) then
				table.insert(animations, composition:GetName());
			end
		end

		local animName = animations[math.random(1, table.getn(animations))];
		if (animName ~= nil) then
			local composition = auxGetTempleEntranceAnimation(animName);

            if (composition ~= nil and composition:IsPaused() == true) then
				auxPlayTempleEntranceAnimation(animName);
			end
		end
		gameState.nextAnimationDelay = math.random(8, 11);
	else
		gameState.nextAnimationDelay = (gameState.nextAnimationDelay - dt >= 0.0 and gameState.nextAnimationDelay - dt or 0.0);
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxTestLevelCompleteCondition()
	if (gameState.allToolsApplied == true and
		gameState.levelCompleted == false and
		playField:GetLevelScreen():HasUncompletedTask() == false) then

		gameState.levelCompleted = true;
		TimerDoString('OnWin();', 2.0, playField:GetTimer());
	end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

------------------------------------------------------------------------------
--
function OnDialogButtonPress(name, param)
end

------------------------------------------------------------------------------
--
function OnUpdate(dt)
    DefaultOnUpdate(dt);

	auxUpdatePeriodicAnimations(dt);
end

------------------------------------------------------------------------------
--
function OnWin()
	DefaultOnWin();
end

------------------------------------------------------------------------------
--
function OnObjectMouseEnter(object)
    local objectName = object:GetName();

    DefaultOnObjectMouseEnter(object);
	ActivateActiveZoneGlow(objectName);
end

------------------------------------------------------------------------------
--
function OnObjectMouseLeave(object)
    local objectName = object:GetName();

    DefaultOnObjectMouseLeave(object);
    DeactivateActiveZoneGlow(objectName);
end

------------------------------------------------------------------------------
--
function OnObjectMouseDown(object)
    local objectName = object:GetName();
    local isWrongClick = true;

	assert(gameState.activeZone ~= nil and gameState.locker:GetNReferences() > 0);

    if (gameState.lockedObjects[objectName] ~= true) then
        if (gameState.activeZone.HasObject(objectName)) then
            isWrongClick = DefaultOnZoomZoneActiveObjectClick(objectName);

			--// ...

	        if (isWrongClick == true and playField:GetLevelScreen():IsTaskObject(objectName)) then
	            auxAttachInPlace(object, playField);
				object:ResetClippingRect();
				--// remove object from zoom-zone which contents it
				assert(gameState.activeZone.objects[objectName] ~= nil);
				gameState.activeZone.objects[objectName] = nil;

                playField:OnObjectFound(object);
                isWrongClick = false;
            end
        else
--			assert(gameState.activeZone ~= RootZoomZone and 
--				   gameState.locker:GetNReferences() > 1 and
--				   'Attempt to close root scene - you have clicked on an object which hasn`t been added to any zoom-zone');
            if (gameState.activeZone ~= RootZoomZone and gameState.locker:GetNReferences() > 1) then
                if (gameState.lockedObjects[gameState.activeZone.activeObject] == nil) then
                    SetZoneVisible(gameState.activeZone, false);
                end
            else
                Log('Lua: OnObjectMouseDown(\''..objectName..'\'): Was made click on object which hasn`t been attached to any zoom-zone');
            end
        end --// if (gameState.activeZone.HasObject(...
    end --// if (gameState.lockedObjects[...

	--// Tips - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
	if (objectName == 'actZoneDiamond' and gameState.medallionOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL14_MEDALLION_TIP1'));
	elseif (objectName == 'actZoneDiamond' and gameState.diamondOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL14_DIAMOND_TIP1'));
	elseif ((objectName == 'actZoneLeftKey' and gameState.leftKeyOnPlace == false) or
			(objectName == 'actZoneRightKey' and gameState.rightKeyOnPlace == false)) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL14_KEY_TIP1'), 
										   GetTextString('LEVEL14_KEY_TIP2'));
	elseif (objectName == 'actZoneRuby' and gameState.rubyOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL14_RUBY_TIP1'));
	elseif (objectName == 'actZoneEmerald' and gameState.emeraldOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL14_EMERALD_TIP1'));
	elseif ((objectName == 'doorMuzzleClosed' and not gameState.emeraldOnPlace) or
			(objectName == 'actZoneMuzzleLeft' and not gameState.medallionOnPlace) or
			(objectName == 'actZoneMuzzleRight' and not gameState.rubyOnPlace)) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL14_STONE_HEADS_TIP1'));
	else
	    playField:GetLevelScreen():HideTip();
	end
	--//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

    DefaultOnObjectClick(object, isWrongClick, not playField:GetLevelScreen():IsTipShown());
    DefaultOnObjectMouseEnter(object);
end

------------------------------------------------------------------------------
--
function OnObjectMouseUp(object)
end

------------------------------------------------------------------------------
--
function OnObjectFound(object)
    local objectName = object:GetName();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	local objectMustBeHighlighted = DefaultOnObjectFound(object);
	return objectMustBeHighlighted;
end

------------------------------------------------------------------------------
--
function OnToolFound(tool)
end

------------------------------------------------------------------------------
--
function CanToolBeApplied(tool, object)
	local toolName = tool:GetName();
	local objName = object:GetName();
    local canToolBeApplied = true;
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	canToolBeApplied = DefaultCanToolBeApplied(tool, object);
	return canToolBeApplied;
end

------------------------------------------------------------------------------
--
function OnToolApply(tool, object)
	local toolName = tool:GetName();
	local objName = object:GetName();
    local toolApplied = false;

	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if (toolName == 'Medallion' and objName == gameState.toolMap[toolName]) then
    	gameState.medallionOnPlace = true;
		toolApplied = true;
		PlaySound('L14S12');
	end
	if (toolName == 'Diamond' and objName == gameState.toolMap[toolName]) then
    	gameState.diamondOnPlace = true;
		toolApplied = true;
		auxOpenGates();
	end
	if (toolName == 'Emerald' and objName == gameState.toolMap[toolName]) then
    	gameState.emeraldOnPlace = true;
		toolApplied = true;
		auxDropDownDiamond();
	end
	if (toolName == 'Ruby' and objName == gameState.toolMap[toolName]) then
    	gameState.rubyOnPlace = true;
		toolApplied = true;
		PlaySound('L14S12');
	end
	if (toolName == 'LeftKey' and objName == gameState.toolMap[toolName]) then
    	gameState.leftKeyOnPlace = true;
		toolApplied = true;
		auxLiftLeftPlatform();
	end
	if (toolName == 'RightKey' and objName == gameState.toolMap[toolName]) then
    	gameState.rightKeyOnPlace = true;
		toolApplied = true;
		auxLiftRightPlatform();
	end
	if (not toolApplied) then
	    playField:GetLevelScreen():ShowTip(GetTextString('WRONG_ITEM_APPLIED_TIP1'),
										   GetTextString('WRONG_ITEM_APPLIED_TIP2'));
	end

	if (gameState.medallionOnPlace == true and
    	gameState.diamondOnPlace == true and
    	gameState.emeraldOnPlace == true and
    	gameState.rubyOnPlace == true and
    	gameState.leftKeyOnPlace == true and
    	gameState.rightKeyOnPlace == true and
		gameState.allToolsApplied == false) then

		gameState.allToolsApplied = true;
		if (playField:GetLevelScreen():HasUncompletedTask() == true) then
		    playField:GetLevelScreen():ShowTip(GetTextString('HAVE_TO_FIND_ITEMS_MSG1'),
											   GetTextString('HAVE_TO_FIND_ITEMS_MSG2'));
		else
			auxTestLevelCompleteCondition();
		end
	end

	auxProcessToolObjectStateAnCursorType();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DefaultOnObjectMouseEnter(object);
	if (toolApplied == true) then
	    DeactivateActiveZoneDeactivatedGlow(object:GetName());
	end
	return toolApplied;
end

------------------------------------------------------------------------------
--
function OnObjectReachPanel(object)
    local objectName = object:GetName();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	auxTestLevelCompleteCondition();
end

------------------------------------------------------------------------------
--
function OnButtonPress(zoneName)
    DefaultOnButtonPress(zoneName);
end

------------------------------------------------------------------------------
--
function OnMouseMove(prevMousePos, currentMousePos)
end

------------------------------------------------------------------------------
--
function OnSetTool(tool)
end

------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData()
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/background.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('RootBackground',anim,512,384,98,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/archer.png',0,0,49,80,1,0)
	anim:SetHotSpot(24,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('archer',anim,332,666,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/axe2.png',0,0,97,65,1,0)
	anim:SetHotSpot(48,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('axe2',anim,567,484,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/axe3.png',0,0,70,81,1,0)
	anim:SetHotSpot(35,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('axe3',anim,212,591,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/axe.png',0,0,84,105,1,0)
	anim:SetHotSpot(42,52)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('axe',anim,444,419,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/basil.png',0,0,91,85,1,0)
	anim:SetHotSpot(45,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('basil',anim,778,704,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/basket2.png',0,0,118,97,1,0)
	anim:SetHotSpot(59,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('basket2',anim,859,724,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/basket.png',0,0,95,102,1,0)
	anim:SetHotSpot(47,51)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('basket',anim,629,555,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/cat.png',0,0,53,121,1,0)
	anim:SetHotSpot(26,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('cat',anim,232,350,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/catStatuette.png',0,0,91,84,1,0)
	anim:SetHotSpot(45,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('catStatuette',anim,562,634,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/dragon.png',0,0,72,88,1,0)
	anim:SetHotSpot(36,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('dragon',anim,287,721,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/duck.png',0,0,93,60,1,0)
	anim:SetHotSpot(46,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('duck',anim,945,387,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/fangNecklace.png',0,0,66,47,1,0)
	anim:SetHotSpot(33,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('fangNecklace',anim,284,121,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/feather.png',0,0,46,61,1,0)
	anim:SetHotSpot(23,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('feather',anim,812,659,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/feathers.png',0,0,120,124,1,0)
	anim:SetHotSpot(60,62)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('feathers',anim,963,670,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/fish.png',0,0,75,61,1,0)
	anim:SetHotSpot(37,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('fish',anim,926,713,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/fishes.png',0,0,101,73,1,0)
	anim:SetHotSpot(50,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('fishes',anim,666,707,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/flower1.png',0,0,52,50,1,0)
	anim:SetHotSpot(26,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('flower1',anim,231,460,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/flower2.png',0,0,55,53,1,0)
	anim:SetHotSpot(27,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('flower2',anim,928,440,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/flower3.png',0,0,75,68,1,0)
	anim:SetHotSpot(37,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('flower3',anim,388,631,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/frog.png',0,0,60,119,1,0)
	anim:SetHotSpot(30,59)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('frog',anim,155,483,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/hare.png',0,0,80,57,1,0)
	anim:SetHotSpot(40,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('hare',anim,627,72,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/horse.png',0,0,87,145,1,0)
	anim:SetHotSpot(43,72)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('horse',anim,453,693,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/hunter.png',0,0,55,93,1,0)
	anim:SetHotSpot(27,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('hunter',anim,806,285,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/knife.png',0,0,45,80,1,0)
	anim:SetHotSpot(22,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('knife',anim,727,226,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/lash.png',0,0,94,92,1,0)
	anim:SetHotSpot(47,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('lash',anim,586,717,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/lettuce.png',0,0,84,53,1,0)
	anim:SetHotSpot(42,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('lettuce',anim,554,574,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/lion.png',0,0,122,83,1,0)
	anim:SetHotSpot(61,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('lion',anim,443,58,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/mask2.png',0,0,61,102,1,0)
	anim:SetHotSpot(30,51)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mask2',anim,992,68,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/mask.png',0,0,70,71,1,0)
	anim:SetHotSpot(35,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mask',anim,232,690,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/moccasins.png',0,0,93,76,1,0)
	anim:SetHotSpot(46,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('moccasins',anim,696,736,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/palmPrint.png',0,0,50,54,1,0)
	anim:SetHotSpot(25,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('palmPrint',anim,850,645,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/pattern1.png',0,0,39,93,1,0)
	anim:SetHotSpot(19,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pattern1',anim,145,159,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/pattern2.png',0,0,26,99,1,0)
	anim:SetHotSpot(13,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pattern2',anim,760,251,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/pattern3.png',0,0,69,71,1,0)
	anim:SetHotSpot(34,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pattern3',anim,954,577,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/plant.png',0,0,73,55,1,0)
	anim:SetHotSpot(36,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('plant',anim,714,652,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/pot.png',0,0,69,82,1,0)
	anim:SetHotSpot(34,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pot',anim,533,490,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/pumpkin.png',0,0,78,86,1,0)
	anim:SetHotSpot(39,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pumpkin',anim,661,477,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/skull.png',0,0,99,82,1,0)
	anim:SetHotSpot(49,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('skull',anim,374,711,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/spear.png',0,0,28,234,1,0)
	anim:SetHotSpot(14,117)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('spear',anim,380,269,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Misc/statuette.png',0,0,97,243,1,0)
	anim:SetHotSpot(48,121)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('statuette',anim,974,282,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/columnLeft.png',0,0,42,70,1,0)
	anim:SetHotSpot(21,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('columnLeft',anim,329,538,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/columnRight.png',0,0,42,66,1,0)
	anim:SetHotSpot(21,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('columnRight',anim,826,528,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/doorLock2.png',0,0,162,24,1,0)
	anim:SetHotSpot(81,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('doorLock2',anim,531,305,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/doorLockPinion.png',0,0,72,72,1,0)
	anim:SetHotSpot(36,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('doorLockPinion',anim,530,306,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/doorMuzzleClosed.png',0,0,55,88,1,0)
	anim:SetHotSpot(27,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('doorMuzzleClosed',anim,529,125,109,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/doorMuzzleOpened.png',0,0,51,67,1,0)
	anim:SetHotSpot(25,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('doorMuzzleOpened',anim,527,138,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/innerDoorBL.png',0,0,110,131,1,0)
	anim:SetHotSpot(55,65)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('innerDoorBL',anim,505,371,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/innerDoorBR.png',0,0,88,130,1,0)
	anim:SetHotSpot(44,65)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('innerDoorBR',anim,567,371,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/innerDoorTL.png',0,0,110,178,1,0)
	anim:SetHotSpot(55,89)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('innerDoorTL',anim,505,217,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/innerDoorTR.png',0,0,90,179,1,0)
	anim:SetHotSpot(45,89)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('innerDoorTR',anim,566,216,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LaverOverLeftTorch.png',0,0,43,51,1,0)
	anim:SetHotSpot(21,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LaverOverLeftTorch',anim,226,71,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverAxe.png',0,0,50,66,1,0)
	anim:SetHotSpot(25,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverAxe',anim,435,442,108,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverColumnLeft.png',0,0,46,84,1,0)
	anim:SetHotSpot(23,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverColumnLeft',anim,328,530,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverColumnRight.png',0,0,46,84,1,0)
	anim:SetHotSpot(23,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverColumnRight',anim,825,523,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverDoor.png',0,0,349,357,1,0)
	anim:SetHotSpot(175,179)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverDoor',anim,530,267,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverDuck.png',0,0,109,54,1,0)
	anim:SetHotSpot(54,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverDuck',anim,964,394,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverHare.png',0,0,30,53,1,0)
	anim:SetHotSpot(15,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverHare',anim,621,68,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverKnife.png',0,0,23,16,1,0)
	anim:SetHotSpot(11,8)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverKnife',anim,733,206,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverLion.png',0,0,121,95,1,0)
	anim:SetHotSpot(60,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverLion',anim,446,60,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverMask2.png',0,0,75,63,1,0)
	anim:SetHotSpot(37,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverMask2',anim,988,40,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverPumpkin.png',0,0,55,41,1,0)
	anim:SetHotSpot(27,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverPumpkin',anim,649,488,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverRightTorch.png',0,0,39,45,1,0)
	anim:SetHotSpot(19,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverRightTorch',anim,816,89,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/layerOverMedallion.png',0,0,75,63,1,0)
	anim:SetHotSpot(37,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('layerOverMedallion',anim,146,30,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverLeftCup.png',0,0,124,40,1,0)
	anim:SetHotSpot(62,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverLeftCup',anim,327,504,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/LayerOverRightCup.png',0,0,120,46,1,0)
	anim:SetHotSpot(60,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverRightCup',anim,828,498,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/muzzleLeftOpened.png',0,0,75,91,1,0)
	anim:SetHotSpot(37,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('muzzleLeftOpened',anim,295,80,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneMuzzleLeft',anim,296,75,99,0,0.8,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/muzzleRightOpened.png',0,0,66,87,1,0)
	anim:SetHotSpot(33,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('muzzleRightOpened',anim,740,89,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneMuzzleRight',anim,750,81,99,0,0.8,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/outerDoorBL.png',0,0,123,187,1,0)
	anim:SetHotSpot(61,93)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('outerDoorBL',anim,511,343,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/outerDoorBR.png',0,0,86,163,1,0)
	anim:SetHotSpot(43,81)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('outerDoorBR',anim,568,356,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/outerDoorTL.png',0,0,112,168,1,0)
	anim:SetHotSpot(56,84)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('outerDoorTL',anim,502,210,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Layers/outerDoorTR.png',0,0,119,178,1,0)
	anim:SetHotSpot(59,89)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('outerDoorTR',anim,556,216,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/fire1.png',0,0,86,128,31,14)
	anim:SetHotSpot(43,64)
	anim:SetBlendMode(0)
	anim:SetColor('0xDDFFBBFF')
	play_field:CreateObject('gobletFlameLeft',anim,329,437,106,0,-1.6,1.6)
	local anim = CreateAnimation('data/Texture/Scenes/Common/fire1.png',0,0,86,128,31,14)
	anim:SetHotSpot(43,64)
	anim:SetBlendMode(0)
	anim:SetColor('0xDDFFBBFF')
	play_field:CreateObject('gobletFlameRight',anim,825,429,106,0,1.6,1.6)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFAA00')
	play_field:CreateObject('gobletFlameLeftGlow',anim,312,431,108,0,3,4)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFAA00')
	play_field:CreateObject('gobletFlameRightGlow',anim,823,414,108,0,3,4)
	local anim = CreateAnimation('data/Texture/Scenes/Common/fire3.png',0,0,64,128,31,12)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(0)
	anim:SetColor('0xDDFFAF10')
	play_field:CreateObject('torchFlameLeft',anim,227,11,103,0,-0.9,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/fire3.png',0,0,64,128,31,12)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(0)
	anim:SetColor('0xDDFFAF10')
	play_field:CreateObject('torchFlameRight',anim,818,25,103,0,0.9,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFA000')
	play_field:CreateObject('torchFlameLeftGlow',anim,215,46,107,0,2,2.4)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFA000')
	play_field:CreateObject('torchFlameRightGlow',anim,819,55,107,0,2,2.4)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFF20FF00')
	play_field:CreateObject('emeraldGlow',anim,281,165,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFF2000')
	play_field:CreateObject('rubyGlow',anim,753,174,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFF0080FF')
	play_field:CreateObject('diamondGlow',anim,527,302,106,0,2,2)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Diamond.png',0,0,45,47,1,0)
	anim:SetHotSpot(22,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Diamond',anim,534,120,108,0,0.6,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Emerald.png',0,0,78,82,1,0)
	anim:SetHotSpot(39,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Emerald',anim,825,502,104,0,0.4,0.4)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/LeftKey.png',0,0,68,34,1,0)
	anim:SetHotSpot(34,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LeftKey',anim,306,79,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Medallion.png',0,0,84,85,1,0)
	anim:SetHotSpot(42,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Medallion',anim,170,36,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/RightKey.png',0,0,68,34,1,0)
	anim:SetHotSpot(34,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('RightKey',anim,744,89,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Ruby.png',0,0,65,92,1,0)
	anim:SetHotSpot(32,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Ruby',anim,329,506,104,0,0.5,0.5)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Diamond_onPlace.png',0,0,16,18,1,0)
	anim:SetHotSpot(8,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Diamond_onPlace',anim,531,305,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Emerald_onPlace.png',0,0,24,26,1,0)
	anim:SetHotSpot(12,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Emerald_onPlace',anim,284,167,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/LeftKey_onPlace.png',0,0,31,49,1,0)
	anim:SetHotSpot(15,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LeftKey_onPlace',anim,339,589,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Medallion_onPlace.png',0,0,39,39,1,0)
	anim:SetHotSpot(19,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Medallion_onPlace',anim,530,305,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/RightKey_onPlace.png',0,0,19,47,1,0)
	anim:SetHotSpot(9,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('RightKey_onPlace',anim,821,576,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Ruby_onPlace.png',0,0,24,32,1,0)
	anim:SetHotSpot(12,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Ruby_onPlace',anim,759,178,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneDiamond',anim,531,305,106,0,0.9,0.9)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneEmerald',anim,285,170,103,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneRuby',anim,758,177,103,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneLeftKey',anim,324,593,106,0,0.8,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneRightKey',anim,834,570,106,0,0.8,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Diamond_ghost.png',0,0,32,32,1,0)
	anim:SetHotSpot(16,16)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Diamond_ghost',anim,531,305,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Emerald_ghost.png',0,0,64,64,1,0)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Emerald_ghost',anim,284,167,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/LeftKey_ghost.png',0,0,134,104,1,0)
	anim:SetHotSpot(67,52)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LeftKey_ghost',anim,351,572,110,0,0.7,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Medallion_ghost.png',0,0,50,50,1,0)
	anim:SetHotSpot(25,25)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Medallion_ghost',anim,531,306,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/RightKey_ghost.png',0,0,134,104,1,0)
	anim:SetHotSpot(67,52)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('RightKey_ghost',anim,845,561,110,0,0.7,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/14_TempleEntrance/Items/Ruby_ghost.png',0,0,64,64,1,0)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Ruby_ghost',anim,759,178,110,0,1,1)
end

function FreeData()
end
-- CLEAR_ON_SAVE_END
