
-----------------------------------------------------------------
--
WEIGHT_AMOUNT = 5;

TABLET_AMOUNT = 3;

function OnSceneLoad(screen)
    LoadData(screen);

	play_field.game_state = game_state;
	MiniGameField = screen;
	
    game_state = {}
	game_state.elements_to_finish = 0;
    game_state.locked_objects = {};
    game_state.custom_cursors = {};
    game_state.active_objects = {}
    game_state.locker = ReferenceCounter()
    game_state.game_complite = false;
	game_state.screen = screen;
	game_state.HELP_STRING = "HELP_MINIGAME_14";
	game_state.state = "three_tabletes";
	
	game_state.locked_objects['bak'] = true;
	game_state.locked_objects['perekladina'] = true;
	game_state.locked_objects['chasha_left'] = true;
	game_state.locked_objects['chasha_right'] = true;
	game_state.locked_objects['pixel_left'] = true;
	game_state.locked_objects['pixel_right'] = true;
	game_state.locked_objects['detal_2'] = true;
	
	screen:IgnoreOnTestPoint("pakrtik")
	
	Koromislo = screen:GetObject("perekladina");
	MiniGameField:GetObject('pakrtik'):SetVisible(false);
	MiniGameField:GetObject('tabletka_4'):SetVisible(false);
	MiniGameField:GetObject('podstavka'):SetVisible(false);
	
	TablesCoords = {}
	Tables = {}
	
	Tables[1] = screen:GetObject("aspirin");
	auxAttachInPlace(screen:GetObject("7"), Tables[1]);
	screen:GetObject("7"):SetVisible(false);
	Tables[2] = screen:GetObject("soporific");
	auxAttachInPlace(screen:GetObject("8"), Tables[2]);
	screen:GetObject("8"):SetVisible(false);
	Tables[3] = screen:GetObject("vitamin_b");
	auxAttachInPlace(screen:GetObject("10"), Tables[3]);
	screen:GetObject("10"):SetVisible(false);
	TablesCoords[1] = Tables[2]:GetPosition();
	TablesCoords[2] = Tables[3]:GetPosition();
	TablesCoords[3] = Tables[1]:GetPosition();
	
	VesValue = {"?", "?", "?"}
	
	local Ves = {7, 8, 10};
	local VesFlag = {true, true, true};
	
	Object = {};
	Object["chasha_left"] = {};
	Object["chasha_left"].Object = screen:GetObject("chasha_left"); 
	Object["chasha_left"].StartPos = Object["chasha_left"].Object:GetPosition();
	Object["chasha_left"].Type = 0;
	
	Object["chasha_right"] = {};
	Object["chasha_right"].Object = screen:GetObject("chasha_right"); 
	Object["chasha_right"].StartPos = Object["chasha_right"].Object:GetPosition();
	Object["chasha_right"].Type = 0;
	
	for i = 1, WEIGHT_AMOUNT do
		Object["girya_"..i] = {};
		Object["girya_"..i].Object = screen:GetObject("girya_"..i); 
		Object["girya_"..i].NeedPos = Object["girya_"..i].Object:GetPosition();
		Object["girya_"..i].Z = 200 - i;
		
		Object["girya_"..i].Object:SetXY(50 + (40 + 2 * i)* i, 650);
		Object["girya_"..i].StartPos = Object["girya_"..i].Object:GetPosition();
		Object["girya_"..i].Target = Object["chasha_left"]; 
		Object["girya_"..i].Type = 1;
		Object["girya_"..i].Ves = i;
		Object["girya_"..i].Active = false;
	end
	for i = 1, TABLET_AMOUNT do
		Object["tabletka_"..i] = {};
		Object["tabletka_"..i].Object = screen:GetObject("tabletka_"..i); 
		Object["tabletka_"..i].NeedPos = Object["tabletka_"..i].Object:GetPosition();
		Object["tabletka_"..i].Z = 200 + i;
		
		Object["tabletka_"..i].Object:SetXY(690 + (130) * (i - 1), 700);
		Object["tabletka_"..i].StartPos = Object["tabletka_"..i].Object:GetPosition();
		Object["tabletka_"..i].Target = Object["chasha_right"]; 
		Object["tabletka_"..i].Type = 2;
		Object["tabletka_"..i].Active = false;
		local rand = 0;
		repeat 
			rand = math.random(3);
		until VesFlag[rand] ~= false
		
		Object["tabletka_"..i].Ves = Ves[rand];
		VesFlag[rand] = false;
		
		Tables[rand]:SetXY(TablesCoords[i].x, TablesCoords[i].y);
	end
	Object["tabletka_4"] = {};
	Object["tabletka_4"].Object = screen:GetObject("tabletka_4"); 
	Object["tabletka_4"].NeedPos = Object["tabletka_1"].NeedPos;
	Object["tabletka_4"].Z = 101;
	
	Object["tabletka_4"].StartPos = Object["tabletka_4"].Object:GetPosition();
	Object["tabletka_4"].Target = Object["chasha_right"]; 
	Object["tabletka_4"].Type = 3;
	Object["tabletka_4"].Active = false;
	Object["tabletka_4"].Ves = 8;
	
	-----------------------------------------------------------------------------------------
	tabletke_enabled = true;

	--
	auxAttachInPlace(screen:GetObject("pixel_left"), screen:GetObject("perekladina"));
   	auxAttachInPlace(screen:GetObject("pixel_right"), screen:GetObject("perekladina"));
   	
   	auxAttachInPlace(screen:GetObject("sprait_cepi"), screen:GetObject("chasha_left"));
   	
	LeftMassa = 0;
   	RightMassa = 0;
   	
	game_state.timer = screen:GetTimer()
	AddMiniGamesGUI(screen);
	
	screen:SetLayer(2);  
	InitComics1(screen);
	InitComics2(screen);
	InitComics3(screen);
	
	AddSheriffEyeLogic(screen)
	
	if(SKIP_START_TIME ~= nil) then
		TimerDo(game_state.timer, SKIP_START_TIME + 0.1, ShowComics1);
	else
		TimerDo(game_state.timer, 0.5, ShowComics1);
	end
end

function OnSceneFree(screen)
    FreeData(screen);
end


------------------------------------------------------------------------------------------------------------------
--Comics

function InitComics1(screen)
	local comics1 = CreateComics(screen,                                                                  
                                 'Sheriff',
								 'eyes')
   
    comics1.OnHidden = function()
		minigames_gui.skip_pause = false;
        game_state.locker:Release();
    end
    
    game_state.chain1 = CreateChain('pixel', screen, comics1, GetString("COMICS_14_4")) 
    
    comics1.OnShown = function()
		minigames_gui.skip_pause = true;
        OnMinigameComicsShown(comics1)
    end
end

function InitComics2(screen)
	local comics1 = CreateComics(screen,                                                                  
                                 'Sheriff',
								 'eyes')  
								 
    game_state.chain2 = CreateChain('pixel_2', screen, 
												comics1, GetString("COMICS_14_5")) 
	
	comics1.OnHidden = function()
       MiniGameField:GetObject('pakrtik'):SetVisible(true);
       MiniGameField:GetObject('pakrtik'):ChangeOpacity(0.0, 1.0, 0.2);
       MiniGameField:GetObject('tabletka_4'):SetVisible(true);
       MiniGameField:GetObject('tabletka_4'):ChangeOpacity(0.0, 1.0, 0.2);
       minigames_gui.skip_pause = false;
    end
    
	comics1.OnShown = function()
		minigames_gui.skip_pause = true;
		OnMinigameComicsShown(comics1)
    end
end

function InitComics3(screen)
	local comics2 = CreateComics(screen,                                                                  
                                 'Sheriff',
								 'eyes')  
								 
    game_state.finish_dialog = CreateChain('pixel_3', screen, 
												comics2, GetString("COMICS_14_6")) 
	
	comics2.OnShown = function()
		OnMinigameComicsShown(comics2)
    end
    
	comics2.OnHidden = function()
        game_state.locker:Release();
        OnCompletedGame();
    end
end
--game_state.locker:Release() 

function ShowComics1()
	game_state.chain1.Start();
end

------------------------------------------------------------------------------------------------------------------

--Drag functions

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

function StartDrag(object)
	local Obj = Object[object:GetName()];
	if(Obj ~= nil) then
		if (Obj.Active == true) then
			Obj.Active = false;
			if(Obj.Type == 1) then
				LeftMassa = LeftMassa - Obj.Ves;
			end
			if(Obj.Type == 2 or Obj.Type == 3) then
				tabletke_enabled = true;
				RightObject = nil;
				RightMassa = RightMassa - Obj.Ves;
			end
			auxAttachInPlace(Obj.Object, MiniGameField);
		end
		DragObject = object;
		DragObject:SetXY(GetMouseX(), GetMouseY());
		DragObject:SetZ(500);
	end
end

function DragUpdate()
	if (DragObject ~= nil) then
		DragObject:SetXY(GetMouseX(), GetMouseY());
	end
end

function StopDrag()
	if (DragObject ~= nil) then
		local Obj = Object[DragObject:GetName()];
		local dx = Obj.Target.StartPos.x - Obj.Target.Object:GetScrX();
		local dy = Obj.Target.StartPos.y - Obj.Target.Object:GetScrY();
		
		if ((math.abs(Obj.NeedPos.x - DragObject:GetX() - dx) < 100 and math.abs(Obj.NeedPos.y - DragObject:GetY() - dy) < 100) 
			and ((Obj.Type ~= 2  and Obj.Type ~= 3) or tabletke_enabled == true)) then
			
			DragObject:SetScrXY(Obj.NeedPos.x - dx, Obj.NeedPos.y - dy);
			auxAttachInPlace(Obj.Object, Obj.Target.Object);
			if(Obj.Type == 1) then
				LeftMassa = LeftMassa + Obj.Ves;
				PlaySound('14_WeightPlace')
			end
			if(Obj.Type == 2 or Obj.Type == 3) then
				tabletke_enabled = false;
				RightMassa = RightMassa + Obj.Ves;
				RightObject = Obj;
				PlaySound('14_PillPlace')
			end
			Obj.Active = true;
		else
			DragObject:Move(Obj.StartPos.x - DragObject:GetScrX(), Obj.StartPos.y - DragObject:GetScrY(), 0.1);
		end
		
		DragObject:SetZ(Obj.Z);
		DragObject = nil;
	end
end

function GetCurrentTabletIndex()
	for i = 1, TABLET_AMOUNT do
		if(Object["tabletka_"..i].Active == true) then
			return i;
		end
	end
	
	return 0;
end
-------------- 


function IsComplite()
	for i = 1, TABLET_AMOUNT do
		if(VesValue[i] == '?')then
			return false;
		end
	end
	
	return true;
end

function StartComics(Index)
	game_state.comics[Index].SetVisible(true);
end

------------------------------------------------------------------------


function OnScreenShown()
end

function OnUpdate(dt)
	DragUpdate();
	
	local ballanse_koef = 0.001 * (dt * 40);
	
	if ((RightMassa - LeftMassa) / 50 > Koromislo:GetAngle()) then
		Koromislo:SetAngle(Koromislo:GetAngle() + ballanse_koef);
		if(Koromislo:GetAngle() > M_PI_OVER_4) then
			Koromislo:SetAngle(M_PI_OVER_4);
		end
	end
	if ((RightMassa - LeftMassa) / 50 < Koromislo:GetAngle()) then
		Koromislo:SetAngle(Koromislo:GetAngle() - ballanse_koef);
		if(Koromislo:GetAngle() < -M_PI_OVER_4) then
			Koromislo:SetAngle(-M_PI_OVER_4);
		end
	end
	
	MiniGameField:GetObject("chasha_right"):SetScrXY(MiniGameField:GetObject("pixel_right"):GetScrX(),MiniGameField:GetObject("pixel_right"):GetScrY());
	MiniGameField:GetObject("chasha_left"):SetScrXY(MiniGameField:GetObject("pixel_left"):GetScrX(),MiniGameField:GetObject("pixel_left"):GetScrY());
	
	if(Koromislo:GetAngle() < 0.001 and Koromislo:GetAngle() > -0.001) then
		local Index = GetCurrentTabletIndex();

		if (RightMassa == LeftMassa and (VesValue[Index] == "?" or (game_state.state == "one_tablet" and RightObject ~= nil and RightObject.Type == 3))) then
			VesValue[Index] = RightMassa;
			
			if(game_state.state == "three_tabletes") then
				PlaySound('14_NumberAppear');
				MiniGameField:GetObject(""..RightMassa):SetVisible(true);
				MiniGameField:GetObject(""..RightMassa):ChangeOpacity(0.0, 1.0, 0.2);
				local obj = MiniGameField:GetObject(""..RightMassa);
				AddBubblesExplosion(obj, MiniGameField, 1.0, 0.0, obj:GetScrX(), obj:GetScrY(), 1.0, 1.0, 1.0);
				local af = CreateAnimationEffector()--AnimationEffector()
				af:AttachTo(MiniGameField:GetObject(""..RightMassa))
				af:SetKey(_TRACK_S, 0.0, 0.5)
				af:SetKey(_TRACK_S, 0.2, 1.0)
				af:SetKey(_TRACK_S, 0.25, 1.2)
				af:SetKey(_TRACK_S, 0.3, 1.0)
				af:Play()
			elseif(game_state.state == "one_tablet") then
				game_state.state = "complited";
				MiniGameField:GetObject('podstavka'):SetVisible(true);
				TimerDo(game_state.timer, 0.5, ShowDoneButton);
			end
			if(IsComplite() == true and game_state.state == "three_tabletes") then
				--ShowDoneButton();
				game_state.state = "one_tablet"
				game_state.chain2:Start();
			end
		end
	end

end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end
 
function OnObjectMouseDown(object)
	if(game_state.locked_objects[object:GetName()] == true) then
		return;
	end
	
	StartDrag(object);
	
	DefaultOnObjectMouseDown(object)
end

function OnObjectMouseUp(object)
	StopDrag();
end

function OnMouseMove(previous_pos, current_pos)
end

function OnObjectRightMouseUp(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title);
    OnMiniGameButtonPress(title);
end

function SkipMiniGame()
	if(game_state.game_skip == false) then
		game_state.chain1:OnClick();
		game_state.game_skip = true
		Skip = true;
		
		for i = 1, TABLET_AMOUNT do
			VesValue[i] = Object["tabletka_"..i].Ves;
		end
		
		return 0.2;
    end
    
    return -1.0;
end

function OnLostFocus()
end

function OnGainFocus()
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/14_Ballance/bak.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bak',anim,512,384,95,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/chasha_left.png',0,0,198,411,1,0)
	anim:SetHotSpot(75,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('chasha_left',anim,208,131,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/chasha_right.png',0,0,202,404,1,0)
	anim:SetHotSpot(105,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('chasha_right',anim,712,128,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/perekladina.png',0,0,549,349,1,0)
	anim:SetHotSpot(275,55)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('perekladina',anim,465,132,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/girya_1.png',0,0,32,45,1,0)
	anim:SetHotSpot(16,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('girya_1',anim,212,450,205,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/girya_2.png',0,0,49,62,1,0)
	anim:SetHotSpot(24,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('girya_2',anim,236,444,204,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/girya_3.png',0,0,50,74,1,0)
	anim:SetHotSpot(25,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('girya_3',anim,191,426,203,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/girya_4.png',0,0,52,73,1,0)
	anim:SetHotSpot(26,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('girya_4',anim,271,425,202,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/girya_5.png',0,0,71,94,1,0)
	anim:SetHotSpot(35,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('girya_5',anim,227,395,201,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/tabletka_1.png',0,0,70,58,1,0)
	anim:SetHotSpot(35,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tabletka_1',anim,702,437,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/tabletka_2.png',0,0,62,56,1,0)
	anim:SetHotSpot(31,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tabletka_2',anim,702,435,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/tabletka_3.png',0,0,60,49,1,0)
	anim:SetHotSpot(30,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tabletka_3',anim,705,437,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel_right',anim,712,128,100,0,5,5)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel_left',anim,208,131,100,0,5,5)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/detal_2.png',0,0,103,119,1,0)
	anim:SetHotSpot(51,59)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('detal_2',anim,459,107,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/sprait_cepi.png',0,0,27,68,1,0)
	anim:SetHotSpot(13,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_cepi',anim,263,433,250,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/Sheriff.dds',0,0,530,636,1,0)
	anim:SetHotSpot(266,256)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Sheriff',anim,378,390,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Comics/eyes.png',0,0,79,33,1,0)
	anim:SetHotSpot(39,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('eyes',anim,369,212,500,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel_2',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel_3',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/tabletka_1.png',0,0,70,58,1,0)
	anim:SetHotSpot(35,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tabletka_4',anim,551,689,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/pakrtik.png',0,0,154,121,1,0)
	anim:SetHotSpot(77,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pakrtik',anim,550,680,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/aspirin.png',0,0,168,144,1,0)
	anim:SetHotSpot(84,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('aspirin',anim,967,589,98,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/podstavka.png',0,0,140,151,1,0)
	anim:SetHotSpot(70,75)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('podstavka',anim,546,567,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/vitamin_b.png',0,0,151,148,1,0)
	anim:SetHotSpot(84,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('vitamin_b',anim,829,583,98,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/10.png',0,0,50,53,1,0)
	anim:SetHotSpot(25,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('10',anim,819,564,99,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/7.png',0,0,41,42,1,0)
	anim:SetHotSpot(20,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('7',anim,953,566,99,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/soporific.png',0,0,141,147,1,0)
	anim:SetHotSpot(84,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('soporific',anim,698,593,98,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/8.png',0,0,49,44,1,0)
	anim:SetHotSpot(24,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('8',anim,682,564,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/14_Ballance/kolby.png',0,0,435,107,1,0)
	anim:SetHotSpot(217,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('kolby',anim,819,697,99,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
