function OnSceneLoad(screen)
	LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/32_Lift_MG.lua', 'mini_game', 'data/Scenes/32_Lift_Main.lua')
	LinkScene('area', 'CursorDoorDown', 'data/Scenes/32_Lift_Main.lua', false)
	
	InitOutro(screen);
	
	mini_game_completed = false;
	
	game_screen = screen;
	
	play_field:IgnoreOnTestPoint('TubeBottomLayer')
	play_field:IgnoreOnTestPoint('TubeTopLayer')
 
	tube_obj = screen:GetObject('TubeBottomLayer'); 
	
	----------------------------------------------------------------------------------------------------------------------------------
	SLOT_AMOUNT = 16;
	
	Slots = {}
	for i = 1, 7 do
		Slots[i] = {}
		Slots[i].Pos = Vector(tube_obj:GetX() - 55 - (7 - i) * 46, tube_obj:GetY() - 4);
	end
	
	Slots[8] = {}
	Slots[8].Pos = Vector(tube_obj:GetX() + 3, tube_obj:GetY() - 4);
		
	for i = 1, 7 do
		Slots[i + 8] = {}
		Slots[i + 8].Pos = Vector(tube_obj:GetX() + 60 + (i - 1) * 46, tube_obj:GetY() - 4);
	end	
	
	Slots[16] = {}
	Slots[16].Pos = Vector(tube_obj:GetX() + 3, tube_obj:GetY() + 47);
	
	for i = 1, SLOT_AMOUNT do
		Slots[i].free = true;
	end
	----------------------------------------------------------------------------------------------------------------------------------
	OBJECTS_AMOUNT = 8;
	Objects = {}
		
	-- черные шары
	for i = 1, 4 do
		Objects[i] = {}
		Objects[i].Entity = screen:GetObject("Ball_Black_"..i);		
		Objects[i].Entity:SetXY(Slots[i].Pos.x, Slots[i].Pos.y);
		Objects[i].Type = 2;
		Objects[i].slot_index = i;
		Slots[i].free = false;
	end
	
	--белые шары
	for i = 5, 8 do
		Objects[i] = {}
		Objects[i].Entity = screen:GetObject("Ball_White_"..(i - 4));
		Objects[i].Entity:SetXY(Slots[20 - i].Pos.x, Slots[20 - i].Pos.y);
		Objects[i].Type = 1;
		Slots[20 - i].free = false;
		Objects[i].slot_index = 20 - i;
	end
	
	ShowMonolog('C_32_LIFT_MG', 'C_32_LIFT_MG');
	
	LoadSound('32_Drop_ball', 'data/Sound/32_Lift/MG/Drop_ball.ogg')
	LoadSound('32_Lock_turning', 'data/Sound/32_Lift/MG/Lock_turning.ogg')
	LoadSound('32_Balls_roll_out', 'data/Sound/32_Lift/MG/Balls_roll_out.ogg')
	
	play_field.dropBallSound = MakeSoundEntity('32_Drop_ball');
end

function OnSceneFree(screen)
    DefaultOnSceneFree()
    FreeData(screen)
end


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function GetObjectByName(obj_name)
	for i = 1, OBJECTS_AMOUNT do
		if(Objects[i].Entity:GetName() == obj_name) then
			return Objects[i];
		end
	end
	
	return nil;
end

function StartDrag(obj)
	DragObject = obj;
	DragObject.Entity:SetZ(130);
	
	left = tube_obj:GetX() - 330;
	right = tube_obj:GetX() + 330;
	top = tube_obj:GetY() - 9;
	
	local index = DragObject.slot_index;
	
	if(index == 16) then
		index = 8;
		
		if(Slots[8].free == false) then
			top = tube_obj:GetY() + 11;
		end
	end
	
 	for i = index - 1, 1, -1 do
		if(Slots[i].free == false)then	
			left = Slots[i + 1].Pos.x;
			break;
		end
	end
	
	for i = index + 1, 15 do
		if(Slots[i].free == false)then	
			right = Slots[i - 1].Pos.x;
			break;
		end
	end
	Slots[DragObject.slot_index].free = true;
	--DragObject.slot_index = -1;
end

function UpdateDrag()
	if(DragObject ~= nil) then
		DragObject.Entity:SetXY(GetMousePos().x, GetMousePos().y);
		
		if(DragObject.Entity:GetX() < left) then
            DragObject.Entity:SetX(left);
        end
        
        if(DragObject.Entity:GetX() > right) then
            DragObject.Entity:SetX(right);
        end
		
		if(DragObject.Entity:GetY() < top) then
			DragObject.Entity:SetY(top);
		end
		
		if(DragObject.Entity:GetY() > tube_obj:GetY() + 6) then
			if(DragObject.Entity:GetX() < tube_obj:GetX() - 10 or DragObject.Entity:GetX() > tube_obj:GetX() + 15) then
				if(Slots[8].free == true or DragObject.slot_index ~= 16) then
					DragObject.Entity:SetY(tube_obj:GetY() + 6);
				end
			elseif(Slots[16].free == false) then
				DragObject.Entity:SetY(tube_obj:GetY() + 6);
			end
		end
		
		if(DragObject.Entity:GetY() > tube_obj:GetY() + 46) then
		--	if(DragObject.Entity:GetX() > tube_obj:GetX() and DragObject.Entity:GetX() < tube_obj:GetX() + 25) then
				DragObject.Entity:SetY(tube_obj:GetY() + 46);
		--	end
		end
		
		if(DragObject.Entity:GetY() < tube_obj:GetY() + 12) then
			if(DragObject.Entity:GetX() < left) then
				DragObject.Entity:SetX(left);
			end
			
			if(DragObject.Entity:GetX() > right) then
				DragObject.Entity:SetX(right);
			end
		else
			if(DragObject.Entity:GetX() < tube_obj:GetX() - 12) then
				DragObject.Entity:SetX(tube_obj:GetX() - 12);
			end
			if(DragObject.Entity:GetX() > tube_obj:GetX() + 16) then
				DragObject.Entity:SetX(tube_obj:GetX() + 16);
			end
		end
		
		if(Slots[8].free == false and DragObject.slot_index == 16) then
			if(DragObject.Entity:GetX() < tube_obj:GetX() + 3) then
				DragObject.Entity:SetX(tube_obj:GetX() + 3);
			end
			if(DragObject.Entity:GetX() > tube_obj:GetX() + 3) then
				DragObject.Entity:SetX(tube_obj:GetX() + 3);
			end
			if(DragObject.Entity:GetY() < tube_obj:GetY() + 40) then
				DragObject.Entity:SetY(tube_obj:GetY() + 40);
			end
		end
	end
end

function IsComplete()
	for i = 1, 4 do
		if(Objects[i].slot_index < 12) or (Objects[i].slot_index > 15) then
			return false;
		end
	end
	
	return true;
end

function StopDrag()
	if(DragObject ~= nil) then
		for i = 1,SLOT_AMOUNT do
			if (math.abs(DragObject.Entity:GetX() - Slots[i].Pos.x) < 30 and math.abs(DragObject.Entity:GetY() - Slots[i].Pos.y) < 60) then
				if(i == 8 and Slots[16].free == true) then
					i = 16;
				end
				if(DragObject.Type == 2) then
					DragObject.Entity:Move(Slots[i].Pos.x - DragObject.Entity:GetX(), Slots[i].Pos.y - DragObject.Entity:GetY(), 0.2);
				else
					DragObject.Entity:Move(Slots[i].Pos.x - DragObject.Entity:GetX(), Slots[i].Pos.y - DragObject.Entity:GetY(), 0.2);
				end
				Slots[i].free = false;
				DragObject.slot_index = i;
				break;
			end
		end
		DragObject.Entity:SetZ(120);
		DragObject = nil;
		
		play_field.dropBallSound:StopSound();
		play_field.dropBallSound:Play(false)
		
		if( IsComplete()) then
			FinishGame();
		end
	end
end

function FinishGame()

    mini_game_completed = true;

	for i = 5, 8 do
		Objects[i].Entity:ChangeOpacity(1.0, 0.0, 0.1);
	end

	PlayOutro();
	
	MakeSoundEntity('32_Lock_turning'):Play(false);
	TimerDoString("MakeSoundEntity('32_Balls_roll_out'):Play(false);", 3, play_field:GetTimer());
	LoadSound('32_Balls_roll_out', 'data/Sound/32_Lift/MG/Balls_roll_out.ogg')
	
	TimerDoString("StartLevel('data/Scenes/33_Scene_Luk.lua')", 6.0, game_screen:GetTimer())
	
	if HasGameState('MiniGameCompleted', '32_Lift') == false then
		AddGameState('MiniGameCompleted', '32_Lift');
	end
end

function auxAttachInPlace(object, parentObject, z)
	local scrX,scrY = object:GetScrX(), object:GetScrY();
	object:AttachTo(parentObject);
	object:SetScrXY(scrX, scrY);
	--object:SetZ(z);
end

function SkipMiniGame()
	if HasGameState('MiniGameCompleted', '32_Lift') == false then
		AddGameState('MiniGameCompleted', '32_Lift');
	end
	
	-- черные шары
	for i = 1, 4 do
		Objects[i].Entity:SetXY(Slots[15 - i].Pos.x, Slots[15 - i].Pos.y);
		Objects[i].slot_index = 20 - i;
	end
	
	--белые шары
	for i = 5, 8 do
		Objects[i].Entity:SetXY(Slots[i - 4].Pos.x, Slots[i - 4].Pos.y);
		Objects[i].slot_index = i;
	end
	
	FinishGame();
	
	--TimerDoString("StartLevel('data/Scenes/33_Scene_Luk.lua')", 0.5, game_screen:GetTimer())
end

function InitOutro(screen)
--	local movieDuration = 8.32;
--	screen:SetDuration(movieDuration);
	
	zOffset = 110.0;
	
	-- Верхний слой трубки
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Layer_Tube_Cover.png");
	anim:SetHotSpot(456, 57);
	anim:SetColor('0xDDFFFFFF')
	object = screen:CreateObject("TubeTopLayer", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(544.5, 300);
	object:SetZ(135);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetOpacity(1);

	-- нижный слой трубки
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Layer_Tube_Down.png");
	anim:SetHotSpot(456, 57);
	object = screen:CreateObject("TubeBottomLayer", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(544.0, 300);
	object:SetZ(zOffset + 5);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetAngle(0);
	object:SetOpacity(1);
	
	
	-- Шар 1
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Ball_Black.png");
	anim:SetColor('0xFFFFFFFF')
	object = screen:CreateObject("Ball_Black_1", anim, 0, 0, 0, 0, 1, 1);
	object:SetZ(zOffset + 10);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetAngle(0);

	-- Шар 2
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Ball_Black.png");
	anim:SetColor('0xFFFFFFFF')
	object = screen:CreateObject("Ball_Black_2", anim, 0, 0, 0, 0, 1, 1);
	object:SetZ(zOffset + 9);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetAngle(0);

	-- Шар 3
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Ball_Black.png");
	anim:SetColor('0xFFFFFFFF')
	object = screen:CreateObject("Ball_Black_3", anim, 0, 0, 0, 0, 1, 1);
	object:SetZ(zOffset + 8);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetAngle(0);

	-- Шар 4
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Ball_Black.png");
	anim:SetColor('0xFFFFFFFF')
	object = screen:CreateObject("Ball_Black_4", anim, 0, 0, 0, 0, 1, 1);
	object:SetZ(zOffset + 7);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetAngle(0);

	-- коромысло
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Layer_Platform.png");
	object = screen:CreateObject("Beam", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(609.5, 582);
	object:SetZ(zOffset + 4);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetOpacity(1);
	
	-- банка
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Layer_Bottle.png");
	object = screen:CreateObject("Bottle", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(917, 565);
	auxAttachInPlace(screen:GetObject("Bottle"), screen:GetObject("Beam"), 1);
	object:SetZ(zOffset + 11);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetAngle(0);
	object:SetOpacity(1);	


	-- Змок на шестеренках
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/LAyer_Lock.png");
	object = screen:CreateObject("Lock", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(234, 588.25);
	object:SetZ(zOffset + 3);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetOpacity(1);

	-- Шестеренка 1
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Gear_1.png");
	object = screen:CreateObject("Gear_1", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(140.203857421875, 630.663009643555);
	object:SetZ(zOffset + 2);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetOpacity(1);

	-- Шестеренка 2
	anim = CreateAnimationByTextureName("data/Texture/Minigames/Lift/Gear_2.png");
	object = screen:CreateObject("Gear_2", anim, 0, 0, 0, 0, 1, 1);
	object:SetXY(107.5, 702.75);
	object:SetZ(zOffset + 1);
	object:SetScaleX(1);
	object:SetScaleY(1);
	object:SetOpacity(1);
end

function PlayOutro()
	--game_screen:GetObject("Ball_Black_1"):GetAnimation():SetHotSpot(-(tube_obj:GetX() - tube_obj:GetAnimation():GetWidth() / 2), -(tube_obj:GetY() - tube_obj:GetAnimation():GetHeight() / 2));
	--game_screen:GetObject("Ball_Black_1"):SetXY(tube_obj:GetX(), tube_obj:GetY());
	game_screen:GetObject("Ball_Black_1"):GetAnimation():SetHotSpot(59.5, 33.5);
	game_screen:GetObject("Ball_Black_2"):GetAnimation():SetHotSpot(50.5, 33.5);
	game_screen:GetObject("Ball_Black_3"):GetAnimation():SetHotSpot(41.5, 33.5);
	game_screen:GetObject("Ball_Black_4"):GetAnimation():SetHotSpot(33.5, 33.5);
	
	auxAttachInPlace(game_screen:GetObject("Ball_Black_1"), game_screen:GetObject("TubeBottomLayer"), 1);
	auxAttachInPlace(game_screen:GetObject("Ball_Black_2"), game_screen:GetObject("TubeBottomLayer"), 2);
	auxAttachInPlace(game_screen:GetObject("Ball_Black_3"), game_screen:GetObject("TubeBottomLayer"), 3);
	auxAttachInPlace(game_screen:GetObject("Ball_Black_4"), game_screen:GetObject("TubeBottomLayer"), 4);
	

	--game_screen:GetObject("Ball_White_1"):AttachTo(game_screen:GetObject("TubeBottomLayer"))
	auxAttachInPlace(game_screen:GetObject("TubeTopLayer"), game_screen:GetObject("TubeBottomLayer"), 5);
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("TubeBottomLayer"));

	effector:SetKey(_TRACK_A, 0, 0);
	effector:SetKey(_TRACK_A, 3.44, 0.42954227989268);
	effector:SetKey(_TRACK_A, 4.4080859375, 0.41717151771768);
	effector:SetKey(_TRACK_A, 5.5291015625, 0.42673083763076);

	effector:Play();
	
	-------------------------------------------------------------------------------
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Ball_Black_1"));
	
	local f = game_screen:GetObject("Ball_Black_1"):GetScrX();
	local f2 = game_screen:GetObject("Ball_Black_1"):GetScrY();
	
	effector:SetKey(_TRACK_X, 0, 219.5);
	effector:SetKey(_TRACK_Y, 0, 7);
	effector:SetKey(_TRACK_X, 0.1, 220.987483875859);
	effector:SetKey(_TRACK_Y, 0.1, 7.00000015243999);
	effector:SetKey(_TRACK_X, 0.2, 222.475141209536);
	effector:SetKey(_TRACK_Y, 0.2, 7.00000045786921);
	effector:SetKey(_TRACK_X, 0.3, 223.963193734723);
	effector:SetKey(_TRACK_Y, 0.3, 7.00000070509959);
	effector:SetKey(_TRACK_X, 0.4, 225.451407226729);
	effector:SetKey(_TRACK_Y, 0.4, 6.9999999855953);
	effector:SetKey(_TRACK_X, 0.5, 226.939859041315);
	effector:SetKey(_TRACK_Y, 0.5, 7.0000000110782);
	effector:SetKey(_TRACK_X, 0.6, 228.426531728851);
	effector:SetKey(_TRACK_Y, 0.6, 7.00000039069801);
	effector:SetKey(_TRACK_X, 0.7, 229.913864943825);
	effector:SetKey(_TRACK_Y, 0.7, 7.0000002654195);
	effector:SetKey(_TRACK_X, 0.8, 231.401842117821);
	effector:SetKey(_TRACK_Y, 0.8, 7.00000003845329);
	effector:SetKey(_TRACK_X, 0.9, 232.890456061798);
	effector:SetKey(_TRACK_Y, 0.9, 6.9999998276009);
	effector:SetKey(_TRACK_X, 1, 234.379706467173);
	effector:SetKey(_TRACK_Y, 1, 7.0000009163182);
	effector:SetKey(_TRACK_X, 1.1, 235.869592167196);
	effector:SetKey(_TRACK_Y, 1.1, 7.00000045460369);
	effector:SetKey(_TRACK_X, 1.2, 237.360121351844);
	effector:SetKey(_TRACK_Y, 1.2, 7.00000067128509);
	effector:SetKey(_TRACK_X, 1.3, 238.851299855541);
	effector:SetKey(_TRACK_Y, 1.3, 6.9999995971557);
	effector:SetKey(_TRACK_X, 1.4, 240.343131674246);
	effector:SetKey(_TRACK_Y, 1.4, 7.00000031485951);
	effector:SetKey(_TRACK_X, 1.5, 241.835617672756);
	effector:SetKey(_TRACK_Y, 1.5, 7.00000099835199);
	effector:SetKey(_TRACK_X, 1.6, 243.32874949444);
	effector:SetKey(_TRACK_Y, 1.6, 6.9999998257088);
	effector:SetKey(_TRACK_X, 1.7, 244.822496033919);
	effector:SetKey(_TRACK_Y, 1.7, 7.00000063841669);
	effector:SetKey(_TRACK_X, 1.8, 246.316783625426);
	effector:SetKey(_TRACK_Y, 1.8, 7.0000004003723);
	effector:SetKey(_TRACK_X, 1.9, 247.811416849162);
	effector:SetKey(_TRACK_Y, 1.9, 7.00000099703971);
	effector:SetKey(_TRACK_X, 2, 249.305855519131);
	effector:SetKey(_TRACK_Y, 2, 7.00000081344039);
	effector:SetKey(_TRACK_X, 2.08, 250.499999833373);
	effector:SetKey(_TRACK_Y, 2.08, 7.000000147281);
	effector:SetKey(_TRACK_X, 2.1, 250.609590421915);
	effector:SetKey(_TRACK_Y, 2.1, 7.00000005108799);
	effector:SetKey(_TRACK_X, 2.2, 253.614419798967);
	effector:SetKey(_TRACK_Y, 2.2, 7.0000003682363);
	effector:SetKey(_TRACK_X, 2.3, 259.268122782511);
	effector:SetKey(_TRACK_Y, 2.3, 6.9999991954405);
	effector:SetKey(_TRACK_X, 2.4, 266.579782801343);
	effector:SetKey(_TRACK_Y, 2.4, 7.0000000192877);
	effector:SetKey(_TRACK_X, 2.5, 275.080296972187);
	effector:SetKey(_TRACK_Y, 2.5, 6.999999259743);
	effector:SetKey(_TRACK_X, 2.6, 284.496586807732);
	effector:SetKey(_TRACK_Y, 2.6, 7.00000026801359);
	effector:SetKey(_TRACK_X, 2.7, 294.676554237119);
	effector:SetKey(_TRACK_Y, 2.7, 6.9999994677267);
	effector:SetKey(_TRACK_X, 2.8, 305.537802485058);
	effector:SetKey(_TRACK_Y, 2.8, 7.0000001723685);
	effector:SetKey(_TRACK_X, 2.9, 317.082298857415);
	effector:SetKey(_TRACK_Y, 2.9, 7.00000004892119);
	effector:SetKey(_TRACK_X, 2.92, 319.49999920012);
	effector:SetKey(_TRACK_Y, 2.92, 7.000000253699);
	effector:SetKey(_TRACK_X, 3, 325.958259175191);
	effector:SetKey(_TRACK_Y, 3, 7.0000001010773);
	effector:SetKey(_TRACK_X, 3.1, 334.030467651014);
	effector:SetKey(_TRACK_Y, 3.1, 7.0000001779534);
	effector:SetKey(_TRACK_X, 3.2, 342.10552647221);
	effector:SetKey(_TRACK_Y, 3.2, 6.9999999869686);
	effector:SetKey(_TRACK_X, 3.3, 350.184512419016);
	effector:SetKey(_TRACK_Y, 3.3, 6.9999994945219);
	effector:SetKey(_TRACK_X, 3.4, 358.262949908805);
	effector:SetKey(_TRACK_Y, 3.4, 7.0000005432295);
	effector:SetKey(_TRACK_X, 3.44, 361.500000611217);
	effector:SetKey(_TRACK_Y, 3.44, 7.0000000018491);
	effector:SetKey(_TRACK_X, 3.5, 362.829597423467);
	effector:SetKey(_TRACK_Y, 3.5, 7.0000003795282);
	effector:SetKey(_TRACK_X, 3.6, 365.052396306417);
	effector:SetKey(_TRACK_Y, 3.6, 7.00000067687);
	effector:SetKey(_TRACK_X, 3.7, 367.27608590385);
	effector:SetKey(_TRACK_Y, 3.7, 7.0000003897519);
	effector:SetKey(_TRACK_X, 3.8, 369.500000347301);
	effector:SetKey(_TRACK_Y, 3.8, 6.9999997076937);
	effector:SetKey(_TRACK_X, 3.9, 375.998766253436);
	effector:SetKey(_TRACK_Y, 3.9, 7.2395994506054);
	effector:SetKey(_TRACK_X, 4, 382.498226750146);
	effector:SetKey(_TRACK_Y, 4, 7.43973042483969);
	effector:SetKey(_TRACK_X, 4.1, 388.992606903174);
	effector:SetKey(_TRACK_Y, 4.1, 7.3525946162475);
	effector:SetKey(_TRACK_X, 4.2, 395.500000114627);
	effector:SetKey(_TRACK_Y, 4.2, 6.9999999590747);
	effector:SetKey(_TRACK_X, 4.3, 407.604051305318);
	effector:SetKey(_TRACK_Y, 4.3, 4.7836517812336);
	effector:SetKey(_TRACK_X, 4.4, 419.585124416879);
	effector:SetKey(_TRACK_Y, 4.4, 1.8713459375525);
	effector:SetKey(_TRACK_X, 4.5, 431.651171200683);
	effector:SetKey(_TRACK_Y, 4.5, -0.5623276197413);
	effector:SetKey(_TRACK_X, 4.6, 443.915350356376);
	effector:SetKey(_TRACK_Y, 4.6, -1.3880170804002);
	effector:SetKey(_TRACK_X, 4.68, 453.391575840882);
	effector:SetKey(_TRACK_Y, 4.68, 0.9809752201135);
	effector:SetKey(_TRACK_X, 4.7, 458.828580332369);
	effector:SetKey(_TRACK_Y, 4.7, 5.7448489469778);
	effector:SetKey(_TRACK_X, 4.8, 473.345696062343);
	effector:SetKey(_TRACK_Y, 4.8, 38.8543898534995);
	effector:SetKey(_TRACK_X, 4.84, 477.940002737921);
	effector:SetKey(_TRACK_Y, 4.84, 52.649965834581);
	effector:SetKey(_TRACK_O, 4.84, 1);
	effector:SetKey(_TRACK_O, 4.88, 0);
	effector:Play();
	
	
	local f = game_screen:GetObject("Ball_Black_1"):GetScrX();
	local f2 = game_screen:GetObject("Ball_Black_1"):GetScrY();
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Ball_Black_2"));	
	effector:SetKey(_TRACK_X, 0, 256.5);
	effector:SetKey(_TRACK_Y, 0, 7);
	effector:SetKey(_TRACK_X, 0.1, 257.987482735748);
	effector:SetKey(_TRACK_Y, 0.1, 7.0000006321909);
	effector:SetKey(_TRACK_X, 0.2, 259.475141119314);
	effector:SetKey(_TRACK_Y, 0.2, 6.9999994263131);
	effector:SetKey(_TRACK_X, 0.3, 260.963194566466);
	effector:SetKey(_TRACK_Y, 0.3, 7.0000003260598);
	effector:SetKey(_TRACK_X, 0.4, 262.451408628893);
	effector:SetKey(_TRACK_Y, 0.4, 6.9999999423505);
	effector:SetKey(_TRACK_X, 0.5, 263.939857276085);
	effector:SetKey(_TRACK_Y, 0.5, 7.00000011536);
	effector:SetKey(_TRACK_X, 0.6, 265.426530230748);
	effector:SetKey(_TRACK_Y, 0.6, 6.9999995723746);
	effector:SetKey(_TRACK_X, 0.7, 266.913864436687);
	effector:SetKey(_TRACK_Y, 0.7, 7.0000002511978);
	effector:SetKey(_TRACK_X, 0.8, 268.401842665647);
	effector:SetKey(_TRACK_Y, 0.8, 7.0000006689047);
	effector:SetKey(_TRACK_X, 0.9, 269.890457413602);
	effector:SetKey(_TRACK_Y, 0.9, 6.9999996035035);
	effector:SetKey(_TRACK_X, 1, 271.379706391379);
	effector:SetKey(_TRACK_Y, 1, 7.0000009348735);
	effector:SetKey(_TRACK_X, 1.1, 272.869591666859);
	effector:SetKey(_TRACK_Y, 1.1, 6.9999994645833);
	effector:SetKey(_TRACK_X, 1.2, 274.360121233597);
	effector:SetKey(_TRACK_Y, 1.2, 6.9999995428938);
	effector:SetKey(_TRACK_X, 1.3, 275.851300112944);
	effector:SetKey(_TRACK_Y, 1.3, 7.00000020471821);
	effector:SetKey(_TRACK_X, 1.4, 277.343132140823);
	effector:SetKey(_TRACK_Y, 1.4, 6.9999995187536);
	effector:SetKey(_TRACK_X, 1.5, 278.835617510589);
	effector:SetKey(_TRACK_Y, 1.5, 6.9999999209265);
	effector:SetKey(_TRACK_X, 1.6, 280.328750039325);
	effector:SetKey(_TRACK_Y, 1.6, 7.0000005091708);
	effector:SetKey(_TRACK_X, 1.7, 281.822496763742);
	effector:SetKey(_TRACK_Y, 1.7, 7.0000004407178);
	effector:SetKey(_TRACK_X, 1.8, 283.316783337394);
	effector:SetKey(_TRACK_Y, 1.8, 6.9999993708304);
	effector:SetKey(_TRACK_X, 1.9, 284.811415881543);
	effector:SetKey(_TRACK_Y, 1.9, 6.9999994345836);
	effector:SetKey(_TRACK_X, 2, 286.305854724065);
	effector:SetKey(_TRACK_Y, 2, 7.0000002153691);
	effector:SetKey(_TRACK_X, 2.08, 287.499999796951);
	effector:SetKey(_TRACK_Y, 2.08, 6.9999996559349);
	effector:SetKey(_TRACK_X, 2.1, 287.60959072887);
	effector:SetKey(_TRACK_Y, 2.1, 6.9999994444411);
	effector:SetKey(_TRACK_X, 2.2, 290.61441817349);
	effector:SetKey(_TRACK_Y, 2.2, 7.00000077745899);
	effector:SetKey(_TRACK_X, 2.3, 296.268124209342);
	effector:SetKey(_TRACK_Y, 2.3, 7.0000006518448);
	effector:SetKey(_TRACK_X, 2.4, 303.579783151543);
	effector:SetKey(_TRACK_Y, 2.4, 6.9999997580187);
	effector:SetKey(_TRACK_X, 2.5, 312.080297115502);
	effector:SetKey(_TRACK_Y, 2.5, 6.9999994453566);
	effector:SetKey(_TRACK_X, 2.6, 321.496586759788);
	effector:SetKey(_TRACK_Y, 2.6, 6.9999995533006);
	effector:SetKey(_TRACK_X, 2.7, 331.676556021049);
	effector:SetKey(_TRACK_Y, 2.7, 7.00000078649251);
	effector:SetKey(_TRACK_X, 2.8, 342.537802885827);
	effector:SetKey(_TRACK_Y, 2.8, 6.9999998710898);
	effector:SetKey(_TRACK_X, 2.9, 354.082300358376);
	effector:SetKey(_TRACK_Y, 2.9, 6.9999993733634);
	effector:SetKey(_TRACK_X, 2.92, 356.500000749475);
	effector:SetKey(_TRACK_Y, 2.92, 6.9999991455085);
	effector:SetKey(_TRACK_X, 3, 362.967257385808);
	effector:SetKey(_TRACK_Y, 3, 7.0425944711904);
	effector:SetKey(_TRACK_X, 3.1, 371.049786364653);
	effector:SetKey(_TRACK_Y, 3.1, 7.19141052877799);
	effector:SetKey(_TRACK_X, 3.2, 379.133219505226);
	effector:SetKey(_TRACK_Y, 3.2, 7.3833906025684);
	effector:SetKey(_TRACK_X, 3.3, 387.217253114001);
	effector:SetKey(_TRACK_Y, 3.3, 7.4969161560665);
	effector:SetKey(_TRACK_X, 3.4, 395.289013421176);
	effector:SetKey(_TRACK_Y, 3.4, 7.2847133950724);
	effector:SetKey(_TRACK_X, 3.44, 398.499999802527);
	effector:SetKey(_TRACK_Y, 3.44, 7.0000004389864);
	effector:SetKey(_TRACK_X, 3.5, 401.355048239999);
	effector:SetKey(_TRACK_Y, 3.5, 6.5730178049685);
	effector:SetKey(_TRACK_X, 3.6, 405.912347383434);
	effector:SetKey(_TRACK_Y, 3.6, 5.0867477638518);
	effector:SetKey(_TRACK_X, 3.7, 409.935671869468);
	effector:SetKey(_TRACK_Y, 3.7, 2.4531745731097);
	effector:SetKey(_TRACK_X, 3.8, 414.229267132004);
	effector:SetKey(_TRACK_Y, 3.8, 0.2899587883008);
	effector:SetKey(_TRACK_X, 3.9, 423.821899282223);
	effector:SetKey(_TRACK_Y, 3.9, -2.0177402868876);
	effector:SetKey(_TRACK_X, 4, 433.621364011686);
	effector:SetKey(_TRACK_Y, 4, -3.2849734023494);
	effector:SetKey(_TRACK_X, 4.1, 443.476773729206);
	effector:SetKey(_TRACK_Y, 4.1, -4.0147531308849);
	effector:SetKey(_TRACK_X, 4.12, 445.452674730554);
	effector:SetKey(_TRACK_Y, 4.12, -4.0805361984709);
	effector:SetKey(_TRACK_X, 4.2, 455.39907026142);
	effector:SetKey(_TRACK_Y, 4.2, 14.5862251987125);
	effector:SetKey(_TRACK_X, 4.3, 466.464698075603);
	effector:SetKey(_TRACK_Y, 4.3, 38.7226642447761);
	effector:SetKey(_TRACK_X, 4.4, 477.440316289873);
	effector:SetKey(_TRACK_Y, 4.4, 62.90323101775);
	effector:SetKey(_TRACK_O, 4.4, 1);
	effector:SetKey(_TRACK_O, 4.44, 0.01);
	effector:Play();
	
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Ball_Black_3"));
	effector:SetKey(_TRACK_X, 0, 293.5);
	effector:SetKey(_TRACK_Y, 0, 7);
	effector:SetKey(_TRACK_X, 0.1, 294.987483299852);
	effector:SetKey(_TRACK_Y, 0.1, 7.00000052623071);
	effector:SetKey(_TRACK_X, 0.2, 296.475140710878);
	effector:SetKey(_TRACK_Y, 0.2, 7.0000003284097);
	effector:SetKey(_TRACK_X, 0.3, 297.963193983982);
	effector:SetKey(_TRACK_Y, 0.3, 7.00000007638781);
	effector:SetKey(_TRACK_X, 0.4, 299.45140896633);
	effector:SetKey(_TRACK_Y, 0.4, 7);
	effector:SetKey(_TRACK_X, 0.5, 300.939857806002);
	effector:SetKey(_TRACK_Y, 0.5, 7.0000004983367);
	effector:SetKey(_TRACK_X, 0.6, 302.426531754959);
	effector:SetKey(_TRACK_Y, 0.6, 6.9999991942808);
	effector:SetKey(_TRACK_X, 0.7, 303.913865497536);
	effector:SetKey(_TRACK_Y, 0.7, 7.0000001931211);
	effector:SetKey(_TRACK_X, 0.8, 305.401843241984);
	effector:SetKey(_TRACK_Y, 0.8, 7.0000004735252);
	effector:SetKey(_TRACK_X, 0.9, 306.890456757357);
	effector:SetKey(_TRACK_Y, 0.9, 7.00000024622329);
	effector:SetKey(_TRACK_X, 1, 308.379706612298);
	effector:SetKey(_TRACK_Y, 1, 6.9999995658132);
	effector:SetKey(_TRACK_X, 1.1, 309.869591798632);
	effector:SetKey(_TRACK_Y, 1.1, 7.0000008651387);
	effector:SetKey(_TRACK_X, 1.2, 311.360122392502);
	effector:SetKey(_TRACK_Y, 1.2, 7.00000054884489);
	effector:SetKey(_TRACK_X, 1.3, 312.851300367099);
	effector:SetKey(_TRACK_Y, 1.3, 6.9999994702292);
	effector:SetKey(_TRACK_X, 1.4, 314.343131062906);
	effector:SetKey(_TRACK_Y, 1.4, 6.9999996223029);
	effector:SetKey(_TRACK_X, 1.5, 315.835617394401);
	effector:SetKey(_TRACK_Y, 1.5, 7.0000001372417);
	effector:SetKey(_TRACK_X, 1.6, 317.328750165148);
	effector:SetKey(_TRACK_Y, 1.6, 6.9999994789575);
	effector:SetKey(_TRACK_X, 1.7, 318.822495759863);
	effector:SetKey(_TRACK_Y, 1.7, 6.9999990781274);
	effector:SetKey(_TRACK_X, 1.8, 320.31678315245);
	effector:SetKey(_TRACK_Y, 1.8, 6.999999936491);
	effector:SetKey(_TRACK_X, 1.9, 321.811415407376);
	effector:SetKey(_TRACK_Y, 1.9, 7.0000004318369);
	effector:SetKey(_TRACK_X, 2, 323.305854346518);
	effector:SetKey(_TRACK_Y, 2, 7.00000065358439);
	effector:SetKey(_TRACK_X, 2.08, 324.500000196398);
	effector:SetKey(_TRACK_Y, 2.08, 7.0000005624802);
	effector:SetKey(_TRACK_X, 2.1, 324.609254707175);
	effector:SetKey(_TRACK_Y, 2.1, 7.0000003437605);
	effector:SetKey(_TRACK_X, 2.2, 327.612780109258);
	effector:SetKey(_TRACK_Y, 2.2, 6.9999997514573);
	effector:SetKey(_TRACK_X, 2.3, 333.268689398005);
	effector:SetKey(_TRACK_Y, 2.3, 6.999999603534);
	effector:SetKey(_TRACK_X, 2.4, 340.58088418408);
	effector:SetKey(_TRACK_Y, 2.4, 6.9999999427778);
	effector:SetKey(_TRACK_X, 2.5, 349.079424934275);
	effector:SetKey(_TRACK_Y, 2.5, 7.00000022504349);
	effector:SetKey(_TRACK_X, 2.6, 358.498210370046);
	effector:SetKey(_TRACK_Y, 2.6, 6.9999992891324);
	effector:SetKey(_TRACK_X, 2.7, 368.681151776883);
	effector:SetKey(_TRACK_Y, 2.7, 7.00000037659839);
	effector:SetKey(_TRACK_X, 2.8, 379.533468657646);
	effector:SetKey(_TRACK_Y, 2.8, 7.0000001939146);
	effector:SetKey(_TRACK_X, 2.9, 391.079454100194);
	effector:SetKey(_TRACK_Y, 2.9, 6.9999997110508);
	effector:SetKey(_TRACK_X, 2.92, 393.499999039662);
	effector:SetKey(_TRACK_Y, 2.92, 6.9999998367684);
	effector:SetKey(_TRACK_X, 3, 393.500000396008);
	effector:SetKey(_TRACK_Y, 3, 7.0000005660268);
	effector:SetKey(_TRACK_X, 3.1, 393.499999280709);
	effector:SetKey(_TRACK_Y, 3.1, 6.9999994867092);
	effector:SetKey(_TRACK_X, 3.2, 393.500000599445);
	effector:SetKey(_TRACK_Y, 3.2, 7.0000000057375);
	effector:SetKey(_TRACK_X, 3.24, 393.499999807267);
	effector:SetKey(_TRACK_Y, 3.24, 7.00000011596509);
	effector:SetKey(_TRACK_X, 3.3, 398.66559538243);
	effector:SetKey(_TRACK_Y, 3.3, 5.5793784767148);
	effector:SetKey(_TRACK_X, 3.4, 407.07818441017);
	effector:SetKey(_TRACK_Y, 3.4, 2.5688557561323);
	effector:SetKey(_TRACK_X, 3.5, 415.584961895482);
	effector:SetKey(_TRACK_Y, 3.5, -0.1919212913732);
	effector:SetKey(_TRACK_X, 3.6, 424.29714124709);
	effector:SetKey(_TRACK_Y, 3.6, -2.1542924818908);
	effector:SetKey(_TRACK_X, 3.7, 433.19401980373);
	effector:SetKey(_TRACK_Y, 3.7, -2.4698057074125);
	effector:SetKey(_TRACK_X, 3.8, 441.458003429106);
	effector:SetKey(_TRACK_Y, 3.8, 0.5944011290134);
	effector:SetKey(_TRACK_X, 3.9, 456.233249920739);
	effector:SetKey(_TRACK_Y, 3.9, 25.8855475274967);
	effector:SetKey(_TRACK_X, 4, 465.946374695236);
	effector:SetKey(_TRACK_Y, 4, 53.807578933536);
	effector:SetKey(_TRACK_X, 4.04, 469.919405577156);
	effector:SetKey(_TRACK_Y, 4.04, 64.946206882184);
	effector:SetKey(_TRACK_O, 4.04, 1);
	effector:SetKey(_TRACK_O, 4.08, 0);
	effector:Play();
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Ball_Black_4"));
	effector:SetKey(_TRACK_X, 0, 330.5);
	effector:SetKey(_TRACK_Y, 0, 7);
	effector:SetKey(_TRACK_X, 0.1, 331.988420587186);
	effector:SetKey(_TRACK_Y, 0.1, 7.02560356736259);
	effector:SetKey(_TRACK_X, 0.2, 333.476355569163);
	effector:SetKey(_TRACK_Y, 0.2, 7.08294679515269);
	effector:SetKey(_TRACK_X, 0.3, 334.963943877404);
	effector:SetKey(_TRACK_Y, 0.3, 7.1534298203958);
	effector:SetKey(_TRACK_X, 0.4, 336.451652432954);
	effector:SetKey(_TRACK_Y, 0.4, 7.2266990715739);
	effector:SetKey(_TRACK_X, 0.5, 337.93961277302);
	effector:SetKey(_TRACK_Y, 0.5, 7.29668758886881);
	effector:SetKey(_TRACK_X, 0.6, 339.426084465641);
	effector:SetKey(_TRACK_Y, 0.6, 7.35967350807761);
	effector:SetKey(_TRACK_X, 0.7, 340.913521835745);
	effector:SetKey(_TRACK_Y, 0.7, 7.4135525261291);
	effector:SetKey(_TRACK_X, 0.8, 342.401906714715);
	effector:SetKey(_TRACK_Y, 0.8, 7.4569711821355);
	effector:SetKey(_TRACK_X, 0.9, 343.891186100845);
	effector:SetKey(_TRACK_Y, 0.9, 7.4891385158833);
	effector:SetKey(_TRACK_X, 1, 345.381289159166);
	effector:SetKey(_TRACK_Y, 1, 7.50961851227279);
	effector:SetKey(_TRACK_X, 1.1, 346.872133950294);
	effector:SetKey(_TRACK_Y, 1.1, 7.51822482751849);
	effector:SetKey(_TRACK_X, 1.2, 348.363634961796);
	effector:SetKey(_TRACK_Y, 1.2, 7.5149260547492);
	effector:SetKey(_TRACK_X, 1.3, 349.855705357123);
	effector:SetKey(_TRACK_Y, 1.3, 7.49980376732729);
	effector:SetKey(_TRACK_X, 1.4, 351.348267781728);
	effector:SetKey(_TRACK_Y, 1.4, 7.4730129764507);
	effector:SetKey(_TRACK_X, 1.5, 352.841235458687);
	effector:SetKey(_TRACK_Y, 1.5, 7.4347545782354);
	effector:SetKey(_TRACK_X, 1.6, 354.334524064336);
	effector:SetKey(_TRACK_Y, 1.6, 7.3852659633951);
	effector:SetKey(_TRACK_X, 1.7, 355.828033217465);
	effector:SetKey(_TRACK_Y, 1.7, 7.32480332305271);
	effector:SetKey(_TRACK_X, 1.8, 357.321623090653);
	effector:SetKey(_TRACK_Y, 1.8, 7.2536356824322);
	effector:SetKey(_TRACK_X, 1.9, 358.815044570237);
	effector:SetKey(_TRACK_Y, 1.9, 7.1720491549587);
	effector:SetKey(_TRACK_X, 2, 360.3077084571);
	effector:SetKey(_TRACK_Y, 2, 7.08035437605101);
	effector:SetKey(_TRACK_X, 2.08, 361.500000791247);
	effector:SetKey(_TRACK_Y, 2.08, 6.9999997489072);
	effector:SetKey(_TRACK_X, 2.1, 361.612180225282);
	effector:SetKey(_TRACK_Y, 2.1, 6.9919287257959);
	effector:SetKey(_TRACK_X, 2.2, 364.675135072339);
	effector:SetKey(_TRACK_Y, 2.2, 6.6310383940308);
	effector:SetKey(_TRACK_X, 2.3, 370.367377212212);
	effector:SetKey(_TRACK_Y, 2.3, 5.4988144816634);
	effector:SetKey(_TRACK_X, 2.4, 377.647074863276);
	effector:SetKey(_TRACK_Y, 2.4, 3.6429224601699);
	effector:SetKey(_TRACK_X, 2.5, 386.079479022285);
	effector:SetKey(_TRACK_Y, 2.5, 1.3426114679883);
	effector:SetKey(_TRACK_X, 2.6, 395.461630411393);
	effector:SetKey(_TRACK_Y, 2.6, -1.0437255986732);
	effector:SetKey(_TRACK_X, 2.7, 405.733836356266);
	effector:SetKey(_TRACK_Y, 2.7, -3.0347623300713);
	effector:SetKey(_TRACK_X, 2.8, 416.853705698669);
	effector:SetKey(_TRACK_Y, 2.8, -3.7614178306443);
	effector:SetKey(_TRACK_X, 2.9, 428.344099769687);
	effector:SetKey(_TRACK_Y, 2.9, -1.2202060896126);
	effector:SetKey(_TRACK_X, 2.92, 430.499998786099);
	effector:SetKey(_TRACK_Y, 2.92, -0.0000011671562);
	effector:SetKey(_TRACK_X, 3, 445.921106494765);
	effector:SetKey(_TRACK_Y, 3, 22.3118983860951);
	effector:SetKey(_TRACK_X, 3.1, 457.463756630937);
	effector:SetKey(_TRACK_Y, 3.1, 54.601914372673);
	effector:SetKey(_TRACK_X, 3.16, 463.983142307609);
	effector:SetKey(_TRACK_Y, 3.16, 74.119240635031);
	effector:SetKey(_TRACK_O, 3.16, 1);
	effector:SetKey(_TRACK_O, 3.2, 0);
	effector:Play();
	-------------------------------------------------------------------------------
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Beam"));
	effector:SetKey(_TRACK_A, 3.28, 0);
	effector:SetKey(_TRACK_A, 3.32, 0.00690326799398);
	effector:SetKey(_TRACK_A, 3.64, 0.01874382101029);
	effector:SetKey(_TRACK_A, 4.08, 0.02353144887562);
	effector:SetKey(_TRACK_A, 4.16, 0.03188102475608);
	effector:SetKey(_TRACK_A, 4.4, 0.04214391455469);
	effector:SetKey(_TRACK_A, 4.48, 0.05305552909451);
	effector:SetKey(_TRACK_A, 4.88, 0.06319859087867);
	effector:SetKey(_TRACK_A, 4.96, 0.07696003103004);
	effector:SetKey(_TRACK_A, 5.16, 0.0906114025464);
	effector:SetKey(_TRACK_A, 5.24, 0.10503575686968);
	effector:SetKey(_TRACK_A, 5.64, 0.13271490753134);
	effector:SetKey(_TRACK_A, 6.44, 0.10717771698535);
	effector:SetKey(_TRACK_A, 7.24, 0.11644338523926);
	effector:Play();
	
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Lock"));
	effector:SetKey(_TRACK_A, 3.28, 0);
	effector:SetKey(_TRACK_A, 3.32, -0.07321496272129);
	effector:SetKey(_TRACK_A, 3.64, -0.1227752640535);
	effector:SetKey(_TRACK_A, 4.08, -0.20048224969916);
	effector:SetKey(_TRACK_A, 4.16, -0.25753939957758);
	effector:SetKey(_TRACK_A, 4.4, -0.3059069680917);
	effector:SetKey(_TRACK_A, 4.48, -0.36412575572832);
	effector:SetKey(_TRACK_A, 4.88, -0.391221993884);
	effector:SetKey(_TRACK_A, 4.96, -0.44444922936781);
	effector:SetKey(_TRACK_A, 5.16, -0.48550868202932);
	effector:SetKey(_TRACK_A, 5.24, -0.54238742062365);
	effector:SetKey(_TRACK_A, 5.64, -0.5696035091933);
	effector:Play();
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Gear_1"));
	effector:SetKey(_TRACK_A, 3.28, 0);
	effector:SetKey(_TRACK_A, 3.32, 0.04315218381462);
	effector:SetKey(_TRACK_A, 3.64, 0.08943020631974);
	effector:SetKey(_TRACK_A, 4.08, 0.17518385835201);
	effector:SetKey(_TRACK_A, 4.16, 0.23836993166831);
	effector:SetKey(_TRACK_A, 4.4, 0.30048713300562);
	effector:SetKey(_TRACK_A, 4.48, 0.36218732994434);
	effector:SetKey(_TRACK_A, 4.88, 0.39288183536162);
	effector:SetKey(_TRACK_A, 4.96, 0.45180647840268);
	effector:SetKey(_TRACK_A, 5.16, 0.49211148996749);
	effector:SetKey(_TRACK_A, 5.24, 0.54520453914919);
	effector:SetKey(_TRACK_A, 5.64, 0.56921991227789);
	effector:Play();
	
	effector = CreateAnimationEffector();
	effector:AttachTo(game_screen:GetObject("Gear_2"));
	effector:SetKey(_TRACK_A, 3.28, 0);
	effector:SetKey(_TRACK_A, 3.32, -0.10147779060284);
	effector:SetKey(_TRACK_A, 3.64, -0.20722699489964);
	effector:SetKey(_TRACK_A, 4.08, -0.30878719609067);
	effector:SetKey(_TRACK_A, 4.16, -0.38643738571134);
	effector:SetKey(_TRACK_A, 4.4, -0.47356588355221);
	effector:SetKey(_TRACK_A, 4.48, -0.58933849181863);
	effector:SetKey(_TRACK_A, 4.88, -0.65700604579556);
	effector:SetKey(_TRACK_A, 4.96, -0.76479220630183);
	effector:SetKey(_TRACK_A, 5.16, -0.82871544706502);
	effector:SetKey(_TRACK_A, 5.24, -0.91336119126218);
	effector:SetKey(_TRACK_A, 5.64, -0.97643530908703);

	effector:Play();
end
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


function OnUpdate(dt)
    DefaultOnUpdate(dt)
    UpdateDrag()
end

function OnAllItemsFound()
    DefaultOnAllItemsFound()
end

function OnLose()
    DefaultOnLose()
end

function OnExit()
    DefaultOnExit()
end

function OnClose()
    DefaultOnClose()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    local is_wrong_click = not DefaultOnObjectMouseDown(object)
    local obj_name = object:GetName()
    local pf = play_field

	--PlayOutro(mini_game_screen);

	local obj = GetObjectByName(obj_name);
	
	if(obj ~= nil and mini_game_completed == false)
    then
		StartDrag(obj);
	end
	
    DefaultOnObjectMouseDownProcessed(is_wrong_click);
end

function OnObjectMouseUp(object)
    DefaultOnObjectMouseUp(object)
    StopDrag();
end

function OnObjectFound(object)
    DefaultOnObjectFound(object)
end

function OnToolFound(tool)
    DefaultOnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object)
end

function OnObjectReachPanel(object)
    DefaultOnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
    DefaultOnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
    DefaultOnSetTool(tool)
end

function LevelLoaded(level)
end

function OnSceneDestroy(playfield)
    DefaultOnSceneDestroy(playfield)
end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN 
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Minigames/Lift/BG_Lift.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Lift',anim,512,384,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Lift/Ball_White.png',0,0,67,67,1,0)
	anim:SetHotSpot(33,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	local anim = CreateAnimation('data/Texture/Minigames/Lift/Ball_White.png',0,0,67,67,1,0)
	anim:SetHotSpot(33,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Ball_White_1',anim,198,303,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Lift/Ball_White.png',0,0,67,67,1,0)
	anim:SetHotSpot(33,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Ball_White_2',anim,198,303,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Lift/Ball_White.png',0,0,67,67,1,0)
	anim:SetHotSpot(33,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Ball_White_3',anim,198,303,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Lift/Ball_White.png',0,0,67,67,1,0)
	anim:SetHotSpot(33,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Ball_White_4',anim,198,303,120,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
