dofile('data/Scripts/Scenes/Common.lua');
dofile('data/Scripts/Scenes/Animations/07_HutOnTree_Animations.lua');

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

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

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

							 'actZoneShelf',
							 'actZoneMechanism',
							 'actZoneChest',

							 'actZoneDinoStatuette',
							 'actZonePinion',
							 'actZoneLamp',

							 'mechItem1',
							 'mechItem2',
							 'mechItemJaw',
							 'mechItemHead',
							 'mechItem5',
							 'mechItem5a',
							 'mechItem5f',
							 'mechItem6',
							 'mechItem6a',
							 'mechItem6f',
							 'mechItem7',
							 'mechItem8',
							 'mechItem9',
							 'mechItem10',
							 'mechItem11',
							 'mechBase',
							 'mechItem13',
							 'mechItem14',
							 'mechGate',

							 'mechBasePinion',
							 'box',
							 'dinoStatuetteSign',
							 'LayerOverCrowbar',
							 'openedBoxCap',

							 'LayerOverBucket',
							 'LayerOverCoconut',
							 'LayerOverEagle',
							 'LayerOverHammer',
							 'LayerOverHandbag',
							 'LayerOverLamp',
							 'LayerOverPineapple',
							 'LayerOverRadio',
							 'LayerOverSteeringWheel',

							 'bracelet',
							 'bucket',
							 'candle',
							 'cat',
							 'coconut',
							 'crab',
							 'eagle',
							 'envelope',
							 'gloves',
							 'handbag',
							 'hummer',
							 'kettle',
							 'knife',
							 'lamp',
							 'mantis',
							 'mouse',
							 'nest',
							 'pineapple',
							 'plane',
							 'playingCards',
							 'radio',
							 'screw',
							 'seahorse',
							 'seashell',
							 'steeringWheel',
							 'telescope',
							 'turtle',
							 'twig',
							 'vessel',
							 'woodenBox',

							 'Crowbar',
							 'Hook',
							 'Key',
							 'Pinion',
							 'DinoStatuette_onPlace',
							 'Hook_onPlace',
							 'Pinion_onPlace',
							 'Key_onPlaceGenView'},

							{
							 'DinoStatuette_onPlace',
							 'Hook_onPlace',
							 'Pinion_onPlace'},

							{'lampGlow'});

    ChestZoomZone = CreateZoomZone('ChestZoomZone', RootZoomZone, 
                                   'actZoneChest', 0.0, 
                                   nil, 0.0,
							{'ZoomChestBackground',

							 'chestClosed',
							 'chestOpened',
							 'oldBook',
							 'Zippo'},

							{'chestOpened',
							 'oldBook'});

    MechanismZoomZone = CreateZoomZone('MechanismZoomZone', RootZoomZone, 
                                   'actZoneMechanism', 0.0, 
                                   nil, 0.0,
							{'ZoomMechanismBackground',

							 'actZoneKey',

							 'partHead',
							 'partJaw',
							 'pinionBigL',
							 'pinionSmallL1',
							 'pinionSmallL2',
							 'pinionSmallL3',
							 'pinionBigR',
							 'pinionSmallR1',
							 'pinionSmallR2',
							 'pinionSmallR3',

							 'Key_onPlace'},

							{'Key_onPlace'});

    ShelfZoomZone = CreateZoomZone('ShelfZoomZone', RootZoomZone, 
                                   'actZoneShelf', 0.0, 
                                   nil, 0.0,
							{'ZoomShelfBackground',
							 'boxClosed',
							 'boxOpened',
							 'DinoStatuette',
							 'LayerOverDinoStatuette'},

							{'boxOpened'});
							
if (restoringFromSave == false) then
    AddRandomTasks(true, MISC_TASK_COUNT_24,
		CreateTask('bracelet'),
		CreateTask('bucket'),
		CreateTask('candle'),
		CreateTask('cat'),
		CreateTask('coconut'),
		CreateTask('crab'),
		CreateTask('eagle'),
		CreateTask('envelope'),
		CreateTask('gloves'),
		CreateTask('handbag'),
		CreateTask('hummer'),
		CreateTask('kettle'),
		CreateTask('knife'),
		CreateTask('lamp'),
		CreateTask('mantis'),
		CreateTask('mouse'),
		CreateTask('nest'),
		CreateTask('pineapple'),
		CreateTask('plane'),
		CreateTask('playingCards'),
		CreateTask('radio'),
		CreateTask('screw'),
		CreateTask('seahorse'),
		CreateTask('seashell'),
		CreateTask('steeringWheel'),
		CreateTask('telescope'),
		CreateTask('turtle'),
		CreateTask('twig'),
		CreateTask('vessel'),
		CreateTask('woodenBox')
	);

    playField:GetLevelScreen():AddTaskSafe(CreateTask('DinoStatuette'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Crowbar'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Hook'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Key'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Pinion'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Zippo'));
end

	CreateToolMap(	{'DinoStatuette', 	'actZoneDinoStatuette'},
					{'Crowbar',   		'actZoneChest'},
					{'Hook',      		'box'},
					{'Key',       		'actZoneKey'},
					{'Pinion',    		'actZonePinion'},
					{'Zippo',			'actZoneLamp'});

	SetIconForGameObject(playField:GetObject('bracelet'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/bracelet_icon.png');
	SetIconForGameObject(playField:GetObject('bucket'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/bucket_icon.png');
	SetIconForGameObject(playField:GetObject('candle'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/candle_icon.png');
	SetIconForGameObject(playField:GetObject('cat'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/cat_icon.png');
	SetIconForGameObject(playField:GetObject('coconut'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/coconut_icon.png');
	SetIconForGameObject(playField:GetObject('crab'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/crab_icon.png');
	SetIconForGameObject(playField:GetObject('eagle'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/eagle_icon.png');
	SetIconForGameObject(playField:GetObject('envelope'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/envelope_icon.png');
	SetIconForGameObject(playField:GetObject('gloves'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/gloves_icon.png');
	SetIconForGameObject(playField:GetObject('handbag'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/handbag_icon.png');
	SetIconForGameObject(playField:GetObject('hummer'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/hummer_icon.png');
	SetIconForGameObject(playField:GetObject('kettle'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/kettle_icon.png');
	SetIconForGameObject(playField:GetObject('knife'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/knife_icon.png');
	SetIconForGameObject(playField:GetObject('lamp'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/lamp_icon.png');
	SetIconForGameObject(playField:GetObject('mantis'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/mantis_icon.png');
	SetIconForGameObject(playField:GetObject('mouse'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/mouse_icon.png');
	SetIconForGameObject(playField:GetObject('nest'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/nest_icon.png');
	SetIconForGameObject(playField:GetObject('pineapple'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/pineapple_icon.png');
	SetIconForGameObject(playField:GetObject('plane'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/plane_icon.png');
	SetIconForGameObject(playField:GetObject('playingCards'),'data/Texture/Scenes/07_HutOnTree/Items/Misc/playingCards_icon.png');
	SetIconForGameObject(playField:GetObject('radio'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/radio_icon.png');
	SetIconForGameObject(playField:GetObject('screw'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/screw_icon.png');
	SetIconForGameObject(playField:GetObject('seahorse'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/seahorse_icon.png');
	SetIconForGameObject(playField:GetObject('seashell'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/seashell_icon.png');
	SetIconForGameObject(playField:GetObject('steeringWheel'),'data/Texture/Scenes/07_HutOnTree/Items/Misc/steeringWheel_icon.png');
	SetIconForGameObject(playField:GetObject('telescope'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/telescope_icon.png');
	SetIconForGameObject(playField:GetObject('turtle'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/turtle_icon.png');
	SetIconForGameObject(playField:GetObject('twig'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/twig_icon.png');
	SetIconForGameObject(playField:GetObject('vessel'),		'data/Texture/Scenes/07_HutOnTree/Items/Misc/vessel_icon.png');
	SetIconForGameObject(playField:GetObject('woodenBox'),	'data/Texture/Scenes/07_HutOnTree/Items/Misc/woodenBox_icon.png');

	SetIconForGameObject(playField:GetObject('DinoStatuette'),'data/Texture/Scenes/07_HutOnTree/Items/DinoStatuette_icon.png');
	SetIconForGameObject(playField:GetObject('Crowbar'),	'data/Texture/Scenes/07_HutOnTree/Items/Crowbar_icon.png');
	SetIconForGameObject(playField:GetObject('Hook'),		'data/Texture/Scenes/07_HutOnTree/Items/Hook_icon.png');
	SetIconForGameObject(playField:GetObject('Key'),		'data/Texture/Scenes/07_HutOnTree/Items/Key_icon.png');
	SetIconForGameObject(playField:GetObject('Pinion'),		'data/Texture/Scenes/07_HutOnTree/Items/Pinion_icon.png');
	SetIconForGameObject(playField:GetObject('Zippo'),		'data/Texture/Scenes/07_HutOnTree/Items/Zippo_icon.png');

if (restoringFromSave == false) then
    gameState.gateInitialY = playField:GetObject('mechGate'):GetY();
    gameState.gateRaiseHeight = 140.0;
	gameState.boxInitY = playField:GetObject('box'):GetY();
	gameState.hookInitY = playField:GetObject('Hook_onPlace'):GetY();
	gameState.boxAndHookMoveDistance = -100.0;
	gameState.platformRootFinalY = playField:GetObject('actZonePlatformRoot'):GetY();
	gameState.platformRootShift = 260.0;

	gameState.dinoStatuetteOnPlace = false;
	gameState.crowbarUsed = false;
	gameState.hookUsed = false;
	gameState.keyUsed = false;
	gameState.pinionOnPlace = false;
	gameState.zippoUsed = false;

	gameState.boxOpened = false;
	gameState.gateIsMoving = false;
	gameState.boxIsMoving = false;
	gameState.platformIsMoving = false;
	gameState.chestUnblocked = false;

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

	AssignActiveZonesGlow({function() return gameState.dinoStatuetteOnPlace;end,'actZoneDinoStatuette',	'DinoStatuette_ghost'},
						  {function() return gameState.crowbarUsed or
											not gameState.hookUsed; end,		'actZoneChest',			'Crowbar_ghost'},
					      {function() return gameState.hookUsed; end,			'box',					'Hook_ghost'},
						  {function() return gameState.keyUsed; end,			'actZoneKey',			'Key_ghost'},
						  {function() return gameState.pinionOnPlace;end,		'actZonePinion',		'Pinion_ghost'},
						  {function() return gameState.zippoUsed; end,			'actZoneLamp',			'Zippo_ghost'});
						  
    ApplyLevelDump(restoringFromSave);
	SetZoneVisible(RootZoomZone, true, false);

	auxSceneInit(restoringFromSave);
	auxProcessToolObjectStateAnCursorType();
end

------------------------------------------------------------------------------
--
function OnSceneFree()
    FreeData();
    StopSound('L07S10');
    StopSound('L07S11');
    StopSound('L07S12');
    StopSound('L07S14');
    StopSound('L07S15');
    StopSound('L07S16');
    StopSound('L07S17');
    StopSound('L07S18');
end

--// Local auxiliary functions - - - - - - - - - - - - - - - - - - - - - - - -
function auxSceneInit(restoringFromSave)
    local initialActions = function()
    	ShowLevelIntro(07);
    end
	local regularActions = function()
	    PlaySound('L07S18', true);

	    gameState.customCursors['actZoneChest'] = {'CursorZoom'};
	    gameState.customCursors['actZoneMechanism'] = {'CursorZoom'};
	    gameState.customCursors['actZoneShelf'] = {'CursorZoom'};
	    gameState.customCursors['boxClosed'] = {'CursorArms'};
	    
	    playField:IgnoreOnTestPoint('lampGlow');

    	mechHeadEffsGenView = nil;

	    auxSetMechHeadActive(true);
	    auxSetGateMechActive(true);

    	auxSetFibrillationEffector(playField:GetObject('lampGlow'), 0.1);
    	auxCreatePlatformAnimationEffector();

		auxCreateHutOnTreeAnimations(playField:GetObject('RootBackground'));
		auxPlayHutOnTreeAnimation('EnvTop');
		auxPlayHutOnTreeAnimation('Lizard1');
--		auxPlayHutOnTreeAnimation('Lizard2');
--		auxPlayHutOnTreeAnimation('Lizard3');
--		auxPlayHutOnTreeAnimation('Lizard4');

		gameState.nextAnimationDelay = 0;

		gameState.gateIsMoving = false;
		gameState.boxIsMoving = false;
		gameState.platformIsMoving = false;
	end

    if (restoringFromSave == false) then
        initialActions();
        mechHeadEffsGenView = nil;
	   	auxSetMechHeadActive(false);
    end	
    regularActions();

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

function auxProcessToolObjectStateAnCursorType()
    assert(
			gameState.dinoStatuetteOnPlace ~= nil and
			gameState.crowbarUsed ~= nil and
			gameState.hookUsed ~= nil and
			gameState.keyUsed ~= nil and
			gameState.pinionOnPlace ~= nil and
			gameState.zippoUsed ~= nil and

			gameState.gateIsMoving ~= nil and
			gameState.boxIsMoving ~= nil and
			gameState.chestUnblocked ~= nil and
			gameState.boxOpened ~= nil and
		   true);

	if (gameState.dinoStatuetteOnPlace == true) then
		RootZoomZone.UnhideObject('DinoStatuette_onPlace');
		gameState.customCursors['actZoneDinoStatuette'] = nil;
	else
		RootZoomZone.HideObject('DinoStatuette_onPlace');
		gameState.customCursors['actZoneDinoStatuette'] = {'CursorArms'};
	end

	if (gameState.crowbarUsed == true) then
	    assert(gameState.hookUsed == true);
		ChestZoomZone.HideObject('chestClosed');
		ChestZoomZone.UnhideObject('chestOpened');
		if (playField:HasObject('Zippo') == true) then
		    gameState.lockedObjects['actZoneChest'] = nil;
		    gameState.customCursors['actZoneChest'] = {'CursorZoom'};
		end
	else
		ChestZoomZone.HideObject('chestOpened');
		ChestZoomZone.UnhideObject('chestClosed');
		gameState.lockedObjects['actZoneChest'] = true;
		gameState.customCursors['actZoneChest'] = {'CursorArms'};
	end

	if (gameState.hookUsed == true) then
		RootZoomZone.UnhideObject('Hook_onPlace');
		gameState.customCursors['box'] = nil;
		if (gameState.crowbarUsed == false) then
		    gameState.customCursors['actZoneChest'] = {'CursorArms'};
		end
	else
		RootZoomZone.HideObject('Hook_onPlace');
		gameState.customCursors['box'] = {'CursorArms'};
		gameState.customCursors['actZoneChest'] = nil;
		gameState.lockedObjects['actZoneChest'] = true;
	end
	if (gameState.boxIsMoving == false) then
		if (gameState.chestUnblocked == true) then
			playField:GetObject('box'):SetY(gameState.boxInitY + gameState.boxAndHookMoveDistance);
			playField:GetObject('Hook_onPlace'):SetY(gameState.hookInitY + gameState.boxAndHookMoveDistance);
			gameState.customCursors['box'] = nil;
			gameState.customCursors['Hook_onPlace'] = nil;
		else
			playField:GetObject('box'):SetY(gameState.boxInitY);
			playField:GetObject('Hook_onPlace'):SetY(gameState.hookInitY );
			gameState.customCursors['box'] = {'CursorArms'};
			gameState.customCursors['Hook_onPlace'] = {'CursorArms'};
		end
	end

	if (gameState.keyUsed == true) then
		MechanismZoomZone.UnhideObject('Key_onPlace');
		RootZoomZone.UnhideObject('Key_onPlaceGenView');
		gameState.customCursors['actZoneKey'] = nil;
	else
		MechanismZoomZone.HideObject('Key_onPlace');
		RootZoomZone.HideObject('Key_onPlaceGenView');
		gameState.customCursors['actZoneKey'] = {'CursorArms'};
	end
	if (gameState.gateIsMoving == false) then
		auxSetMechHeadActive(not gameState.keyUsed);
	end

	if (gameState.pinionOnPlace == true) then
		RootZoomZone.UnhideObject('Pinion_onPlace');
		gameState.customCursors['actZonePinion'] = nil;
	else
		RootZoomZone.HideObject('Pinion_onPlace');
		gameState.customCursors['actZonePinion'] = {'CursorArms'};
	end
	auxSetGateMechActive(gameState.pinionOnPlace);
	if (gameState.platformIsMoving == false) then
		if (gameState.pinionOnPlace == true) then
			playField:GetObject('actZonePlatformRoot'):SetY(gameState.platformRootFinalY);
		else
			playField:GetObject('actZonePlatformRoot'):SetY(gameState.platformRootFinalY - gameState.platformRootShift);
		end
	end


	if (gameState.zippoUsed == true) then
		playField:GetObject('lampGlow'):SetVisible(true);
		gameState.customCursors['actZoneLamp'] = nil;
	else
		playField:GetObject('lampGlow'):SetVisible(false);
		gameState.customCursors['actZoneLamp'] = {'CursorArms'};
	end

	if (gameState.boxOpened == true) then
		ShelfZoomZone.UnhideObject('boxOpened');
		ShelfZoomZone.HideObject('boxClosed');
		RootZoomZone.UnhideObject('openedBoxCap');
	else
		ShelfZoomZone.HideObject('boxOpened');
		ShelfZoomZone.UnhideObject('boxClosed');
		RootZoomZone.HideObject('openedBoxCap');
	end

	if (playField:HasObject('DinoStatuette') == false) then
		gameState.customCursors['actZoneShelf'] = nil;
		gameState.lockedObjects['actZoneShelf'] = true;
	else
		gameState.customCursors['actZoneShelf'] = {'CursorZoom'};
		gameState.lockedObjects['actZoneShelf'] = nil;
	end
	if (playField:HasObject('Zippo') == false) then
		gameState.customCursors['actZoneChest'] = nil;
		gameState.lockedObjects['actZoneChest'] = true;
	else
		if (gameState.hookUsed) then
			if (gameState.crowbarUsed) then
				gameState.customCursors['actZoneChest'] = {'CursorZoom'};
				gameState.lockedObjects['actZoneChest'] = nil;
			else
				gameState.customCursors['actZoneChest'] = {'CursorArms'};
				gameState.lockedObjects['actZoneChest'] = true;
			end
		else
			gameState.customCursors['actZoneChest'] = nil;
			gameState.lockedObjects['actZoneChest'] = true;
		end
	end
	if (gameState.keyUsed == true) then
		gameState.customCursors['actZoneMechanism'] = nil;
		gameState.lockedObjects['actZoneMechanism'] = true;
	else
		gameState.customCursors['actZoneMechanism'] = {'CursorZoom'};
		gameState.lockedObjects['actZoneMechanism'] = nil;
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxAssignCyclicRotationEffector(object, rotationPeriod, rotateCW, play)
	play = (play ~= nil and play or true);
	assert(object ~= nil);

	local objAngle = object:GetAngle();
	local rotAngle = (rotateCW == false and -M_TWO_PI or M_TWO_PI);
	local eff = CreateAnimationEffector();
	eff:AttachTo(object);
	eff:SetMode(_ANIM_FWD + _ANIM_LOOP);

   	eff:SetKey(_TRACK_A, 0.0, 			 	 objAngle);
   	eff:SetKey(_TRACK_A, rotationPeriod, 	 objAngle + rotAngle);
	if (play == true) then
		eff:Play();
	end
	return eff;
end
function auxAssignCyclicMovementEffector(object, dx,dy, period, play)
	play = (play ~= nil and play or true);
	assert(object ~= nil);

	local objX,objY = object:GetX(), object:GetY();
	local eff = CreateAnimationEffector();
	eff:AttachTo(object);
	eff:SetMode(_ANIM_FWD + _ANIM_LOOP);

   	eff:SetKey(_TRACK_X, 0.0, 		    objX);
   	eff:SetKey(_TRACK_Y, 0.0, 		    objY);
   	eff:SetKey(_TRACK_X, period/2.0,    objX + dx);
   	eff:SetKey(_TRACK_Y, period/2.0,    objY + dy);
   	eff:SetKey(_TRACK_X, period,        objX);
   	eff:SetKey(_TRACK_Y, period,        objY);
	if (play == true) then
		eff:Play();
	end
	return eff;
end
function auxCreateGateAnimationEffector(play)
	local gateObject = playField:GetObject('mechGate');
	local gateY = gameState.gateInitialY;
	local raiseHeight = gameState.gateRaiseHeight;
	local raiseDuration = 3.0;
	local fallDelay = 0.5;
	local fallDuration = 0.3;
	local raiseDelay = 2.0;

	eff = CreateAnimationEffector();
	eff:AttachTo(gateObject);
	eff:SetMode(_ANIM_LOOP);

	eff:SetKey(_TRACK_Y, 0.0, 	 	  		gateY);
	eff:SetKey(_TRACK_Y, raiseDuration, 		gateY - raiseHeight);

	eff:SetKey(_TRACK_Y, raiseDuration + fallDelay, gateY - raiseHeight);	--// delay before a falling 

	do
		local offset = raiseDuration + fallDelay + fallDuration;
		local hitDuration = 0.3;
		eff:SetKey(_TRACK_Y, offset, 					   gateY);
    	eff:SetKey(_TRACK_Y, offset + hitDuration *1.0/6.0, gateY - 10.0);
    	eff:SetKey(_TRACK_Y, offset + hitDuration *2.0/6.0, gateY);
    	eff:SetKey(_TRACK_Y, offset + hitDuration *3.0/6.0, gateY - 5.0);
    	eff:SetKey(_TRACK_Y, offset + hitDuration *4.0/6.0, gateY);
    	eff:SetKey(_TRACK_Y, offset + hitDuration *5.0/6.0, gateY - 2.0);
    	eff:SetKey(_TRACK_Y, offset + hitDuration *6.0/6.0, gateY);

    	eff:SetKey(_TRACK_Y, offset + hitDuration + 2.0, gateY);  --// 2 seconds delay
    end
	if (play ~= false) then
		eff:Play();
	end
	return eff;
end
--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function auxCreateMechEffectors()
	--// animation mechanic-head in general view
	do
		mechHeadEffsGenView = {};
		mechHeadEffsGenView.isActive = true;
		mechHeadEffsGenView['mechItem1'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem1'), 1.0);
		mechHeadEffsGenView['mechItem2'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem2'), 1.0, false);
		mechHeadEffsGenView['mechItem5'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem5'), 1.0);
		mechHeadEffsGenView['mechItem5a']= auxAssignCyclicRotationEffector(playField:GetObject('mechItem5a'), 1.0, false);
		mechHeadEffsGenView['mechItem5f']= auxAssignCyclicRotationEffector(playField:GetObject('mechItem5f'), 1.0);
		mechHeadEffsGenView['mechItem6'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem6'), 1.0, false);
		mechHeadEffsGenView['mechItem6a']= auxAssignCyclicRotationEffector(playField:GetObject('mechItem6a'), 1.0);
		mechHeadEffsGenView['mechItem6f']= auxAssignCyclicRotationEffector(playField:GetObject('mechItem6f'), 1.0, false);
		mechHeadEffsGenView['mechItemJaw']=auxAssignCyclicMovementEffector(playField:GetObject('mechItemJaw'), 0.0,-20.0, 1.0);
		mechHeadEffsGenView['mechGate']=auxCreateGateAnimationEffector();
	end
	--// animation mechanic-head in zoom-zone
	do
		mechHeadEffs = {};
		mechHeadEffs.isActive = true;
		mechHeadEffs['pinionBigL'] 	  = auxAssignCyclicRotationEffector(playField:GetObject('pinionBigL'), 1.0);
		mechHeadEffs['pinionSmallL1'] = auxAssignCyclicRotationEffector(playField:GetObject('pinionSmallL1'), 1.0);
		mechHeadEffs['pinionSmallL2'] = auxAssignCyclicRotationEffector(playField:GetObject('pinionSmallL2'), 1.0, false);
		mechHeadEffs['pinionSmallL3'] = auxAssignCyclicRotationEffector(playField:GetObject('pinionSmallL3'), 1.0);
		mechHeadEffs['pinionBigR'] 	  = auxAssignCyclicRotationEffector(playField:GetObject('pinionBigR'), 1.0, false);
		mechHeadEffs['pinionSmallR1'] = auxAssignCyclicRotationEffector(playField:GetObject('pinionSmallR1'), 1.0, false);
		mechHeadEffs['pinionSmallR2'] = auxAssignCyclicRotationEffector(playField:GetObject('pinionSmallR2'), 1.0);
		mechHeadEffs['pinionSmallR3'] = auxAssignCyclicRotationEffector(playField:GetObject('pinionSmallR3'), 1.0, false);
		mechHeadEffs['partJaw']		  = auxAssignCyclicMovementEffector(playField:GetObject('partJaw'), 0.0,-50.0, 1.0);
	end
	--// animation gate mechanism
	do
		local rotPeriod = 0.8;
		gateMechEffs = {};
		gateMechEffs.isActive = true;
		gateMechEffs['mechItem11'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem11'), 2.0*rotPeriod);
		gateMechEffs['mechItem7'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem7'), rotPeriod, false);
		gateMechEffs['mechItem10'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem10'), rotPeriod);
		gateMechEffs['Pinion_onPlace'] = auxAssignCyclicRotationEffector(playField:GetObject('Pinion_onPlace'), rotPeriod, false);
		gateMechEffs['mechItem9'] = auxAssignCyclicRotationEffector(playField:GetObject('mechItem9'), rotPeriod);
	end
end

function auxSetMechHeadActive(state)
	if (mechHeadEffsGenView == nil) then
		auxCreateMechEffectors();
	end

	if (mechHeadEffsGenView.isActive ~= state) then
		for name,eff in pairs(mechHeadEffsGenView) do
			if (name ~= 'isActive') then
				if (state == true) then
					eff:Play();
				else
					eff:Stop();
					eff:SetToStart();
				end
			end
		end
		mechHeadEffsGenView.isActive = state;
	end

	if (mechHeadEffs.isActive ~= state) then
		for name,eff in pairs(mechHeadEffs) do
			if (name ~= 'isActive') then
				if (state == true) then
					eff:Play();
				else
					eff:Stop();
					eff:SetToStart();
				end
			end
		end
		mechHeadEffs.isActive = state;
	end
end

function auxSetGateMechActive(state)
	if (gateMechEffs == nil) then
		auxCreateMechEffectors();
	end

	if (gateMechEffs.isActive ~= state) then
		for name,eff in pairs(gateMechEffs) do
			if (name ~= 'isActive') then
				if (state == true) then
					eff:Play();
				else
					eff:Stop();
					eff:SetToStart();
				end
			end
		end
		gateMechEffs.isActive = state;
	end
end
--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxDisableGateMovingFlag()
	gameState.gateIsMoving = false;
end
function auxOpenGate()
	local objGate = playField:GetObject('mechGate');
	local gateY = objGate:GetY();
	local gateInitY = gameState.gateInitialY;
	local raiseHeight = gameState.gateRaiseHeight;
	local duration = 1.75;

	gameState.gateIsMoving = true;
	TimerDoString('auxDisableGateMovingFlag();', duration, playField:GetTimer());

	local eff = CreateAnimationEffector();
	eff:AttachTo(objGate);
	eff:SetMode(_ANIM_NOLOOP);

	eff:SetKey(_TRACK_Y, 0.0, 	 	 gateY);
	eff:SetKey(_TRACK_Y, duration, 	 gateInitY - gameState.gateRaiseHeight);
	eff:Play();
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxDisableBoxMovingFlag()
	gameState.boxIsMoving = false;
end
function auxMoveBoxUp()
	local objBox = playField:GetObject('box');
	local objHook = playField:GetObject('Hook_onPlace');
	local duration = 1.2;

	gameState.boxIsMoving = true;
	TimerDoString('auxDisableBoxMovingFlag();', duration, playField:GetTimer());

	objBox:SetY(gameState.boxInitY);
	objHook:SetY(gameState.hookInitY);
	objBox:Move(0.0, gameState.boxAndHookMoveDistance, duration);
	objHook:Move(0.0, gameState.boxAndHookMoveDistance, duration);

	gameState.customCursors['box'] = nil;
	gameState.customCursors['Hook_onPlace'] = nil;
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--// creating platform wiggling
function auxCreatePlatformAnimationEffector()
	local objPlatform = playField:GetObject('platform');
	local objPlatformRoot = playField:GetObject('actZonePlatformRoot');
	local pX = objPlatform:GetX();
	local amplitude = 7.0;
	local duration = 2.0;

	auxAttachInPlace(objPlatform, objPlatformRoot);

	local eff = CreateAnimationEffector();
	eff:AttachTo(objPlatform);
	eff:SetMode(_ANIM_PINGPONG);

	eff:SetKey(_TRACK_X, 0.0, 					pX - 0.55* amplitude);
	eff:SetKey(_TRACK_X, duration * 1.0/7.0, 	pX - 0.5 * amplitude);
	eff:SetKey(_TRACK_X, duration * 2.0/7.0, 	pX - 0.4 * amplitude);
--	eff:SetKey(_TRACK_X, duration * 3.0/7.0, 	pX - 0.1 * amplitude);
--	eff:SetKey(_TRACK_X, duration * 4.0/7.0, 	pX + 0.1 * amplitude);
	eff:SetKey(_TRACK_X, duration * 5.0/7.0, 	pX + 0.4 * amplitude);
	eff:SetKey(_TRACK_X, duration * 6.0/7.0, 	pX + 0.5 * amplitude);
	eff:SetKey(_TRACK_X, duration * 7.0/7.0, 	pX + 0.55* amplitude);
	eff:Play();
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxDisablePlaformMovingFlag()
	gameState.platformIsMoving = false;
end
function auxMovePlatformDown()
	local duration = 2.0;

	gameState.platformIsMoving = true;
	TimerDoString('auxDisablePlaformMovingFlag();', duration, playField:GetTimer());

	local objPlatformRoot = playField:GetObject('actZonePlatformRoot')	

	objPlatformRoot:SetY(gameState.platformRootFinalY - gameState.platformRootShift);
	objPlatformRoot:Move(0.0, gameState.platformRootShift, duration);
end

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

		for compositionName, composition in pairs(hutOnTreeCompositions) 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 = auxGetHutOnTreeAnimation(animName);

            if (composition ~= nil and composition:IsPaused() == true) then
				auxPlayHutOnTreeAnimation(animName);
			end
		end
		gameState.nextAnimationDelay = math.random(4, 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)
	if (gameState.keyUsed == false and name == 'ComicScreen' and param == 'COMIC_CLOSED') then
		auxSetMechHeadActive(true);
    	PlaySound('L07S16', true);
	end
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 (objectName == 'boxClosed' and gameState.boxOpened == false) then
				gameState.boxOpened = true;
				PlaySound('L07S17');
				auxProcessToolObjectStateAnCursorType();
                isWrongClick = false;
			end

	        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 == 'box' and gameState.hookUsed == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_HOOK_TIP1'));
	elseif (objectName == 'actZoneChest' and gameState.crowbarUsed == false and gameState.hookUsed == true) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_CHEST_TIP1'), 
										   GetTextString('LEVEL7_CHEST_TIP2'));
	elseif (objectName == 'actZoneLamp' and gameState.zippoUsed == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_LANTERN_TIP1'));
	elseif (objectName == 'actZoneDinoStatuette' and gameState.dinoStatuetteOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_STATUETTE_TIP1'));
	elseif (objectName == 'actZoneKey' and gameState.keyUsed == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_KEY_TIP1'));
	elseif (objectName == 'actZonePinion' and gameState.pinionOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_PINION_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();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    --// automatic zoom-zone hiding and blocking
	do
	    assert(gameState.activeZone ~= nil);
	    if ((gameState.activeZone == ChestZoomZone and objectName == 'Zippo') or
			(gameState.activeZone == ShelfZoomZone and objectName == 'DinoStatuette')) then
			CloseAndBlockActiveZone();
	    end
	end
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	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 or (toolName == 'Crowbar' and objName == 'actZoneChest');
end

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

	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if (toolName == 'DinoStatuette' and objName == gameState.toolMap[toolName]) then
    	gameState.dinoStatuetteOnPlace = true;
		toolApplied = true;
	end
	if (toolName == 'Crowbar' and objName == gameState.toolMap[toolName]) then
		if (gameState.hookUsed == true) then
	    	gameState.crowbarUsed = true;
			toolApplied = true;
			PlaySound('L07S15');
		else
		    playField:GetLevelScreen():ShowTip(GetTextString('CANNT_USE_ITEM_YET_TIP1'),
											   GetTextString('CANNT_USE_ITEM_YET_TIP2'));
			return;
		end
	end
	if (toolName == 'Hook' and objName == gameState.toolMap[toolName]) then
    	gameState.hookUsed = true;
    	gameState.chestUnblocked = true;
		toolApplied = true;
		auxMoveBoxUp();
	    PlaySound('L07S14');
	end
	if (toolName == 'Key' and objName == gameState.toolMap[toolName]) then
    	gameState.keyUsed = true;
		toolApplied = true;
		local objGate = playField:GetObject('mechGate');
        local gateY = objGate:GetY();
		auxSetMechHeadActive(false);
        objGate:SetY(gateY);
		auxOpenGate();
		StopSound('L07S16');
		PlaySound('L07S11');
	end
	if (toolName == 'Pinion' and objName == gameState.toolMap[toolName]) then
    	gameState.pinionOnPlace = true;
		toolApplied = true;
		auxSetGateMechActive(true);
		auxMovePlatformDown();
		PlaySound('L07S10');
	end
	if (toolName == 'Zippo' and objName == gameState.toolMap[toolName]) then
    	gameState.zippoUsed = true;
		toolApplied = true;
	end
	if (not toolApplied) then
	    playField:GetLevelScreen():ShowTip(GetTextString('WRONG_ITEM_APPLIED_TIP1'),
										   GetTextString('WRONG_ITEM_APPLIED_TIP2'));
	end

	if (gameState.dinoStatuetteOnPlace == true and
	    gameState.crowbarUsed == true and
    	gameState.hookUsed == true and
    	gameState.keyUsed == true and
    	gameState.pinionOnPlace == true and
    	gameState.zippoUsed == 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

    --// automatic zoom-zone hiding and blocking
	do
	    assert(gameState.activeZone ~= nil);
	    if (gameState.activeZone == MechanismZoomZone and toolName  == 'Key'and toolApplied == true) then
			CloseAndBlockActiveZone();
	    end
	end

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

------------------------------------------------------------------------------
--
function OnObjectReachPanel(object)
    local objectName = object:GetName();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if (objectName == 'Key') then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL7_KEY_FOUND_TIP'));
		HighlightGameObject(playField:GetObject('actZoneMechanism'), playField:GetTimer(), 3.0);
		HighlightGameObject(playField:GetObject('actZoneMechanism'), playField:GetTimer(), 2.0);
	end
	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/07_HutOnTree/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,95,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/backgroundWall.png',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('backgroundWall',anim,512,384,98,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('0xFFFFBB44')
	play_field:CreateObject('lampGlow',anim,407,251,103,0,3,4)
	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('actZoneDinoStatuette',anim,316,216,104,0,0.65,0.76)
	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('actZonePinion',anim,946,277,105,0,0.7,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('actZoneLamp',anim,424,267,105,0,0.6,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/bracelet.png',0,0,50,53,1,0)
	anim:SetHotSpot(25,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('bracelet',anim,143,602,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/bucket.png',0,0,75,82,1,0)
	anim:SetHotSpot(37,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('bucket',anim,761,562,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/candle.png',0,0,106,71,1,0)
	anim:SetHotSpot(53,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('candle',anim,170,567,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/cat.png',0,0,87,77,1,0)
	anim:SetHotSpot(43,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('cat',anim,479,73,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/coconut.png',0,0,70,87,1,0)
	anim:SetHotSpot(35,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('coconut',anim,284,602,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/crab.png',0,0,96,58,1,0)
	anim:SetHotSpot(48,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('crab',anim,858,617,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/eagle.png',0,0,64,93,1,0)
	anim:SetHotSpot(32,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('eagle',anim,757,111,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/envelope.png',0,0,90,57,1,0)
	anim:SetHotSpot(45,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('envelope',anim,577,724,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/gloves.png',0,0,113,67,1,0)
	anim:SetHotSpot(56,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('gloves',anim,725,657,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/handbag.png',0,0,91,148,1,0)
	anim:SetHotSpot(45,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('handbag',anim,172,128,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/hummer.png',0,0,74,110,1,0)
	anim:SetHotSpot(37,55)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('hummer',anim,888,552,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/kettle.png',0,0,71,114,1,0)
	anim:SetHotSpot(35,57)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('kettle',anim,654,571,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/knife.png',0,0,99,73,1,0)
	anim:SetHotSpot(49,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('knife',anim,837,725,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/lamp.png',0,0,73,95,1,0)
	anim:SetHotSpot(36,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('lamp',anim,253,484,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/mantis.png',0,0,58,76,1,0)
	anim:SetHotSpot(29,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mantis',anim,955,75,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/mouse.png',0,0,84,73,1,0)
	anim:SetHotSpot(42,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mouse',anim,252,524,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/nest.png',0,0,114,104,1,0)
	anim:SetHotSpot(57,52)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('nest',anim,985,427,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/pineapple.png',0,0,73,78,1,0)
	anim:SetHotSpot(36,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pineapple',anim,256,309,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/plane.png',0,0,108,80,1,0)
	anim:SetHotSpot(54,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('plane',anim,540,589,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/playingCards.png',0,0,122,56,1,0)
	anim:SetHotSpot(61,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('playingCards',anim,399,662,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/radio.png',0,0,103,122,1,0)
	anim:SetHotSpot(51,61)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('radio',anim,979,600,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/screw.png',0,0,90,40,1,0)
	anim:SetHotSpot(45,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('screw',anim,239,754,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/seahorse.png',0,0,70,115,1,0)
	anim:SetHotSpot(35,57)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('seahorse',anim,788,264,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/seashell.png',0,0,71,81,1,0)
	anim:SetHotSpot(35,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('seashell',anim,424,85,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/steeringWheel.png',0,0,108,103,1,0)
	anim:SetHotSpot(54,51)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('steeringWheel',anim,143,298,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/telescope.png',0,0,131,148,1,0)
	anim:SetHotSpot(65,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('telescope',anim,933,699,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/turtle.png',0,0,130,69,1,0)
	anim:SetHotSpot(65,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('turtle',anim,488,543,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/twig.png',0,0,68,53,1,0)
	anim:SetHotSpot(34,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('twig',anim,226,70,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/vessel.png',0,0,75,84,1,0)
	anim:SetHotSpot(37,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('vessel',anim,698,604,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Misc/woodenBox.png',0,0,149,140,1,0)
	anim:SetHotSpot(74,70)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('woodenBox',anim,415,690,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Crowbar.png',0,0,200,76,1,0)
	anim:SetHotSpot(100,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Crowbar',anim,634,711,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Hook.png',0,0,59,145,1,0)
	anim:SetHotSpot(29,72)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Hook',anim,991,480,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Key.png',0,0,50,59,1,0)
	anim:SetHotSpot(25,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Key',anim,922,596,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Pinion.png',0,0,70,75,1,0)
	anim:SetHotSpot(35,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Pinion',anim,973,727,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/DinoStatuette_onPlace.png',0,0,74,71,1,0)
	anim:SetHotSpot(37,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('DinoStatuette_onPlace',anim,315,219,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Hook_onPlace.png',0,0,62,416,1,0)
	anim:SetHotSpot(31,208)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Hook_onPlace',anim,353,208,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Pinion_onPlace.png',0,0,70,75,1,0)
	anim:SetHotSpot(35,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Pinion_onPlace',anim,947,275,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechBasePinion.png',0,0,73,62,3,6)
	anim:SetHotSpot(36,93)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechBasePinion',anim,901,321,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/box.png',0,0,175,186,1,0)
	anim:SetHotSpot(87,93)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('box',anim,349,486,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/dinoStatuetteSign.png',0,0,80,29,1,0)
	anim:SetHotSpot(40,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('dinoStatuetteSign',anim,313,255,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverCrowbar.png',0,0,142,99,1,0)
	anim:SetHotSpot(71,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverCrowbar',anim,585,716,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverBucket.png',0,0,125,107,1,0)
	anim:SetHotSpot(62,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverBucket',anim,759,569,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverCoconut.png',0,0,67,76,1,0)
	anim:SetHotSpot(33,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverCoconut',anim,260,610,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverEagle.png',0,0,46,31,1,0)
	anim:SetHotSpot(23,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverEagle',anim,780,139,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverHammer.png',0,0,59,81,1,0)
	anim:SetHotSpot(29,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverHammer',anim,869,585,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverHandbag.png',0,0,95,164,1,0)
	anim:SetHotSpot(47,82)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverHandbag',anim,146,135,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverLamp.png',0,0,61,36,1,0)
	anim:SetHotSpot(30,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverLamp',anim,306,256,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverPineapple.png',0,0,53,32,1,0)
	anim:SetHotSpot(26,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverPineapple',anim,272,343,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverRadio.png',0,0,111,60,1,0)
	anim:SetHotSpot(55,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverRadio',anim,969,636,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/LayerOverSteeringWheel.png',0,0,105,153,1,0)
	anim:SetHotSpot(52,76)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverSteeringWheel',anim,103,312,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem1.png',0,0,30,31,1,0)
	anim:SetHotSpot(15,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem1',anim,506,167,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem2.png',0,0,31,32,1,0)
	anim:SetHotSpot(15,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem2',anim,695,163,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItemJaw.png',0,0,53,73,1,0)
	anim:SetHotSpot(26,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItemJaw',anim,597,100,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItemHead.png',0,0,285,198,1,0)
	anim:SetHotSpot(142,99)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItemHead',anim,602,118,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem5.png',0,0,21,22,1,0)
	anim:SetHotSpot(10,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem5',anim,512,146,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem5a.png',0,0,21,22,1,0)
	anim:SetHotSpot(10,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem5a',anim,526,160,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem5f.png',0,0,27,29,1,0)
	anim:SetHotSpot(13,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem5f',anim,471,205,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem6.png',0,0,22,23,1,0)
	anim:SetHotSpot(11,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem6',anim,672,155,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem6a.png',0,0,22,23,1,0)
	anim:SetHotSpot(11,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem6a',anim,688,140,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem6f.png',0,0,29,30,1,0)
	anim:SetHotSpot(14,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem6f',anim,734,201,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem7.png',0,0,74,69,1,0)
	anim:SetHotSpot(31,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem7',anim,907,378,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem8.png',0,0,76,65,1,0)
	anim:SetHotSpot(38,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem8',anim,880,132,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem9.png',0,0,61,60,1,0)
	anim:SetHotSpot(30,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem9',anim,994,212,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem10.png',0,0,69,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem10',anim,941,334,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem11.png',0,0,103,104,1,0)
	anim:SetHotSpot(51,52)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem11',anim,865,440,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechBase.png',0,0,264,239,1,0)
	anim:SetHotSpot(132,119)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechBase',anim,897,235,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem13.png',0,0,118,88,1,0)
	anim:SetHotSpot(59,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem13',anim,814,474,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechItem14.png',0,0,83,80,1,0)
	anim:SetHotSpot(41,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechItem14',anim,941,410,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/mechGate.png',0,0,295,513,1,0)
	anim:SetHotSpot(147,256)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechGate',anim,603,252,97,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/openedBoxCap.png',0,0,55,20,1,0)
	anim:SetHotSpot(27,10)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('openedBoxCap',anim,441,129,99,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('actZoneChest',anim,396,517,100,0,1.2,0.9)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Chest/Layers/background.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('ZoomChestBackground',anim,585,456,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Chest/Layers/chestClosed.png',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('chestClosed',anim,582,458,204,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Chest/Layers/chestOpened.png',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('chestOpened',anim,582,458,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Chest/Layers/oldBook.png',0,0,103,94,1,0)
	anim:SetHotSpot(51,47)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('oldBook',anim,515,530,203,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Zippo.png',0,0,80,93,1,0)
	anim:SetHotSpot(40,46)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('Zippo',anim,612,473,203,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('actZoneMechanism',anim,598,105,102,0,1.5,1.2)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/background.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('ZoomMechanismBackground',anim,605,307,200,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('actZoneKey',anim,594,285,205,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/partHead.png',0,0,624,380,1,0)
	anim:SetHotSpot(312,190)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('partHead',anim,596,310,203,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/partJaw.png',0,0,153,182,1,0)
	anim:SetHotSpot(76,91)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('partJaw',anim,598,312,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionBig.png',0,0,90,90,1,0)
	anim:SetHotSpot(45,45)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionBigL',anim,387,396,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionSmall.png',0,0,68,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionSmallL1',anim,405,347,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionSmall.png',0,0,68,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionSmallL2',anim,439,383,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionSmall.png',0,0,68,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionSmallL3',anim,304,479,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionBig.png',0,0,90,90,1,0)
	anim:SetHotSpot(45,45)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionBigR',anim,801,395,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionSmall.png',0,0,68,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionSmallR1',anim,783,347,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionSmall.png',0,0,68,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionSmallR2',anim,751,380,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Mechanism/Layers/pinionSmall.png',0,0,68,68,1,0)
	anim:SetHotSpot(34,34)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('pinionSmallR3',anim,888,481,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Key_onPlace.png',0,0,52,52,1,0)
	anim:SetHotSpot(26,26)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('Key_onPlace',anim,592,286,204,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Key_onPlace.png',0,0,52,52,1,0)
	anim:SetHotSpot(26,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Key_onPlaceGenView',anim,596,108,101,0,0.5,0.5)
	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('actZoneShelf',anim,436,163,100,0,1,1.2)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Shelf/Layers/background.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('ZoomShelfBackground',anim,529,331,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Shelf/Layers/boxClosed.png',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('boxClosed',anim,531,322,204,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Shelf/Layers/boxOpened.png',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('boxOpened',anim,531,323,201,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/DinoStatuette.png',0,0,156,145,1,0)
	anim:SetHotSpot(78,72)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('DinoStatuette',anim,532,343,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Zones/Shelf/Layers/LayerOverDinoStatuette.png',0,0,200,124,1,0)
	anim:SetHotSpot(100,62)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('LayerOverDinoStatuette',anim,512,408,203,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Crowbar_ghost.png',0,0,180,140,1,0)
	anim:SetHotSpot(90,70)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Crowbar_ghost',anim,464,488,100,0,1,-1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/DinoStatuette_ghost.png',0,0,200,180,1,0)
	anim:SetHotSpot(100,90)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('DinoStatuette_ghost',anim,319,217,110,4,0.5,0.5)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Hook_ghost.png',0,0,100,512,1,0)
	anim:SetHotSpot(50,256)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Hook_ghost',anim,353,208,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Key_ghost.png',0,0,70,70,1,0)
	anim:SetHotSpot(35,35)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Key_ghost',anim,594,286,210,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Pinion_ghost.png',0,0,90,90,1,0)
	anim:SetHotSpot(45,45)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Pinion_ghost',anim,946,276,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Items/Zippo_ghost.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Zippo_ghost',anim,394,212,100,30,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/07_HutOnTree/Layers/platform.png',0,0,200,486,1,0)
	anim:SetHotSpot(100,243)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('platform',anim,683,235,96,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('actZonePlatformRoot',anim,0,0,95,0,1,1)
end

function FreeData()
end
-- CLEAR_ON_SAVE_END
