class 'l_02_Lock' (LevelEventHandler)

dofile('data/Scripts/Minigames/02_Lock/02_Lock_anim.lua')

local tool = {'MG_02_01_item_02','MG_02_01_item_01'}

function l_02_Lock:__init(name)
	LevelEventHandler.__init(self, name)

	self.bg_anim = AnimationBundle(Loader_02_mg_Animations(Object('DT4_MG_02_Lock_Bg')))
    
   ObjectOpacity('bug_green',0)
   ObjectOpacity('bug_broun',0)
   play_field:IgnoreOnTestPoint('bug_green')
   play_field:IgnoreOnTestPoint('bug_broun')
   ObjectOpacity('light_green',0)
   ObjectOpacity('light_broun',0)
   play_field:IgnoreOnTestPoint('light_green')
   play_field:IgnoreOnTestPoint('light_broun')
   Helpers.AttachInPlace(Object('light_green'),Object('bug_green'))
   Helpers.AttachInPlace(Object('light_broun'),Object('bug_broun'))
   local toolApply = function(e)
        if e.toolName == tool[1] then
            MakeSoundEntity('02_mg_tool'):PlaySound(false)
            ObjectOpacity('sled_green',0)
            ObjectOpacity('bug_green',1)
        end
        if e.toolName == tool[2] then
            MakeSoundEntity('02_mg_tool'):PlaySound(false)
            ObjectOpacity('sled_broun',0)
            ObjectOpacity('bug_broun',1)
        end
        if IsToolApplied(tool[1]) and IsToolApplied(tool[2]) then
            ObjectOpacity('area_tool',0)
            play_field:DoNotIgnoreOnTestPoint('bug_green')
            play_field:DoNotIgnoreOnTestPoint('bug_broun')
            self:GetPanel():GetAssociatedLuaObject():SetMode(EPanelMode.PM_MINIGAME);
        else
            GetCurrentLevel().custom_cursors['area_tool'] = "CursorGlass";
        end
   end
   RegisterToolApplyInfo(tool[1],'area_tool',toolApply,'BBT_MG_NEED_BUG')
   RegisterToolApplyInfo(tool[2],'area_tool',toolApply,'BBT_MG_NEED_BUG')
   
   self.Direction = {'up','left','right','down'}
   for i = 1,4 do
        Helpers.AttachInPlace( Object('b_arrow_'..self.Direction[i]), Object('area_broun') )
        Helpers.AttachInPlace( Object('g_arrow_'..self.Direction[i]), Object('area_green') )
   end
   
   self:Off_arrow() 

    self.Field = {
                    [1] = {{2,'right'}},
                    [2] = {{1,'left'},{3,'up'}},
                    [3] = {{2,'down'},{4,'left'}},
                    [4] ={{3,'right'},{5,'up'}},
                    [5] ={{4,'down'},{7,'right'},{6,'up'}},
                    [6] ={{5,'down'}},
                    [7] ={{5,'left'},{8,'up'}},
                    [8] ={{7,'down'},{9,'right'}},
                    [9] ={{8,'left'},{10,'right'},{11,'down'}},
                    [10] ={{9,'left'}},
                    [11] ={{9,'up'},{12,'right'}},
                    [12] ={{11,'left'},{13,'up'}},
                    [13] ={{14,'right'},{12,'down'}},
                    [14] ={{13,'left'},{15,'down'},{17,'up'}},
                    [15] ={{14,'up'},{16,'right'}},
                    [16] ={{15,'left'}},
                    [17] ={{14,'down'},{18,'left'},{19,'up'}},
                    [18] ={{17,'right'}},
                    [19] ={{17,'down'}}
                  } 
   self.Angle = {['bug_green'] = {['up'] = 90,['down'] = 270,['left'] = 0,['right'] = 180},['bug_broun'] = {['up'] = 270,['down'] = 90,['left'] = 180,['right'] = 0}}
   
   self.Pos = {['bug_green'] = 16,['bug_broun'] = 1}
   self.Angle_bug = {['bug_green'] = 0,['bug_broun'] = 0}
   
    for i = 1,19 do
        self.Field[i].x = Object('area_'..i):GetX()
        self.Field[i].y = Object('area_'..i):GetY() 
        play_field:DeleteObject('area_'..i);
    end 

    self:SaveLoad()  
end

function l_02_Lock:SaveLoad()
    if IsMiniGameCompleted(self.name) then
        self:GetPanel():GetAssociatedLuaObject():SetMode(EPanelMode.PM_QUEST);
        self:Ignore(true)
        Object('zamok'):SetXY(951,306)
        Object('zamok'):SetScaleX(0.4)
        Object('Krilo_3'):SetAngle(math.rad(17))
        Object('Krilo_3_'):SetAngle(math.rad(-17))
        Object('bug_broun'):SetXY(804,138)
        Object('bug_broun'):SetAngle(math.rad(90))
        Object('bug_green'):SetXY(215,138)
        Object('bug_green'):SetAngle(math.rad(270))
        Object('bug_green'):GetAnimation():Stop()
        Object('bug_broun'):GetAnimation():Stop()
        CompleteMinigame(1)
        return
    end
    
    if HasGameState("02_Lock_Pos") then
        self.Pos = Helpers.RestoreObjectFromGameState("02_Lock_Pos");
        self.Angle_bug = Helpers.RestoreObjectFromGameState("02_Lock_Angle");
        Object('bug_green'):SetXY(self.Field[self.Pos['bug_green']].x,self.Field[self.Pos['bug_green']].y)
        Object('bug_broun'):SetXY(self.Field[self.Pos['bug_broun']].x,self.Field[self.Pos['bug_broun']].y)
        Object('bug_green'):SetAngle(math.rad(self.Angle_bug['bug_green']))
        Object('bug_broun'):SetAngle(math.rad(self.Angle_bug['bug_broun']))
        Object('area_broun'):SetXY(self.Field[self.Pos['bug_broun']].x,self.Field[self.Pos['bug_broun']].y)
        Object('area_green'):SetXY(self.Field[self.Pos['bug_green']].x,self.Field[self.Pos['bug_green']].y)
    end
    
end

function l_02_Lock:Off_arrow()
    ObjectOpacity('light_green',0)
    ObjectOpacity('light_broun',0)
    for i = 1,4 do
       ObjectOpacity('b_arrow_'..self.Direction[i],0)
       ObjectOpacity('g_arrow_'..self.Direction[i],0)
   end
end

function l_02_Lock:MoveAnimation(anim, x, y, time)
    local af = CreateAnimationEffector();
    af:AttachTo(anim);
    af:SetKey(_TRACK_X, 0.0, anim:GetX());
    af:SetKey(_TRACK_Y, 0.0, anim:GetY());
    af:SetKey(_TRACK_X, time, x);
    af:SetKey(_TRACK_Y, time, y);
    af:Play();
end

function l_02_Lock:OnUpdate(dt)
end

function l_02_Lock:OnAllItemsFound()
end

function l_02_Lock:OnObjectMouseEnter(object)
   if string.find(object:GetName(),'bug_') then
        local color = string.sub(object:GetName(),5)
        ObjectOpacity('light_'..color,0.5)
   end
end

function l_02_Lock:OnObjectMouseLeave(object)
    if string.find(object:GetName(),'bug_') then
        local color = string.sub(object:GetName(),5)
        ObjectOpacity('light_'..color,0)
   end
end

function l_02_Lock:OnScreenObjectMouseDown(object, key)
    self:Off_arrow()
    ---------------------------up_bug------------------------------------------------
    if string.find(object:GetName(),'bug_') then
        local bug = object:GetName()
        local color = string.sub(bug,5,5)
        local color_full = string.sub(bug,5)
        ObjectOpacity('light_'..color_full,0)
        for i = 1,#self.Field[self.Pos[bug]] do
            if (self.Field[self.Pos[bug]][i][1] ~= self.Pos['bug_broun'] and self.Field[self.Pos[bug]][i][1] ~= self.Pos['bug_green']) then
                ObjectOpacity(color..'_arrow_'..self.Field[self.Pos[bug]][i][2],1)
            end
        end
        return
    end
    --------------------------/up_bug------------------------------------------------
    if string.find(object:GetName(),'arrow') then
        MakeSoundEntity('02_mg_move'):PlaySound(false)
        local color = string.sub(object:GetName(),1,1)
        local direction = string.sub(object:GetName(),9)
        local color_2 = 0
        local next_pos_2 = 0
        local next_pos,time_rotate = 0,0
        local time_move = 1
        if color == 'g' then
            color = 'green'
            color_2 = 'broun'
        else
            color = 'broun'
            color_2 = 'green'
        end
        for i = 1,#self.Field[self.Pos['bug_'..color]] do
            if self.Field[self.Pos['bug_'..color]][i][2] == direction then
                next_pos = self.Field[self.Pos['bug_'..color]][i][1]
                self.Pos['bug_'..color] = next_pos
                Helpers.SaveObjectToGameState("02_Lock_Pos", self.Pos);
                Object('area_'..color):SetXY(self.Field[next_pos].x,self.Field[next_pos].y)
                self:Ignore(true)
                local cur_angle = Object('bug_'..color):GetAngle()
                if cur_angle > math.rad(350) then
                    cur_angle = 0
                    Object('bug_'..color):SetAngle(0)
                end
                local dif_angle = math.rad(self.Angle['bug_'..color][direction]) - cur_angle
                self.Angle_bug['bug_'..color] = self.Angle['bug_'..color][direction]
                Helpers.SaveObjectToGameState("02_Lock_Angle", self.Angle_bug);
                if ( math.abs( dif_angle ) > math.rad( 180 ) ) then
                    if ( dif_angle > 0 ) then
                        dif_angle = dif_angle - math.rad( 360 )
                    else
                        dif_angle = math.rad( 360 ) + dif_angle
                    end
                end
                if math.abs(dif_angle) > 0.2 then
                    time_rotate = 0.5
                    Object('bug_'..color):Rotate(dif_angle,time_rotate)
                else
                    time_rotate = 0
                end
                self.timer:Add(function()
                                         Object('bug_'..color):MoveTo(self.Field[next_pos].x,self.Field[next_pos].y,time_move)
                end,time_rotate + 0.01)
                self.timer:Add(function()
                                self:Ignore(false)
                end,time_rotate + time_move + 0.01)
                break
            end
        end
        
        local cur_angle = Object('bug_'..color_2):GetAngle()
        if cur_angle > math.rad(350) then
            cur_angle = 0
            Object('bug_'..color_2):SetAngle(0)
        end
        local dif_angle = math.rad(self.Angle['bug_'..color_2][direction]) - cur_angle
        self.Angle_bug['bug_'..color_2] = self.Angle['bug_'..color_2][direction]
        Helpers.SaveObjectToGameState("02_Lock_Angle", self.Angle_bug);
        if ( math.abs( dif_angle ) > math.rad( 180 ) ) then
            if ( dif_angle > 0 ) then
                dif_angle = dif_angle - math.rad( 360 )
            else
                dif_angle = math.rad( 360 ) + dif_angle
            end
        end
        if math.abs(dif_angle) > 0.2 then
            time_rotate = 0.5
            Object('bug_'..color_2):Rotate(dif_angle,time_rotate)
        else
            time_rotate = 0
        end
        
        for i = 1,#self.Field[self.Pos['bug_'..color_2]] do
                if self.Field[self.Pos['bug_'..color_2]][i][2] == direction then
                    next_pos_2 = self.Field[self.Pos['bug_'..color_2]][i][1]
                    self.Pos['bug_'..color_2] = next_pos_2
                    Helpers.SaveObjectToGameState("02_Lock_Pos", self.Pos);
                    Object('area_'..color_2):SetXY(self.Field[next_pos_2].x,self.Field[next_pos_2].y)
                    self.timer:Add(function()
                                             Object('bug_'..color_2):MoveTo(self.Field[next_pos_2].x,self.Field[next_pos_2].y,time_move)
                    end,time_rotate + 0.01)
                    break
                end
        end
        
        if self.Pos['bug_broun'] == 19 and self.Pos['bug_green'] == 6 then
            CompleteMinigame(9)
            self:GetPanel():GetAssociatedLuaObject():SetMode(EPanelMode.PM_QUEST);
            self.timer:Add(function()
                        ObjectOpacity('zamok',0)
                        ObjectOpacity('bug_green',0)
                        ObjectOpacity('bug_broun',0)
                        ObjectOpacity('Krilo_3_',0)
                        ObjectOpacity('Krilo_3',0)
                        self.bg_anim:PlayAnimation('final')
                        MakeSoundEntity('02_mg_final'):PlaySound(false)
            end,time_rotate + time_move + 0.01)
        end
        
    end
    
    self:Off_arrow()
end

function l_02_Lock:SkipMiniGame()
    self:Off_arrow()
    self:GetPanel():GetAssociatedLuaObject():SetMode(EPanelMode.PM_QUEST);
    self:Ignore(true)
    ObjectOpacity('zamok',0)
    ObjectOpacity('bug_green',0)
    ObjectOpacity('bug_broun',0)
    ObjectOpacity('Krilo_3_',0)
    ObjectOpacity('Krilo_3',0)
    self.bg_anim:PlayAnimation('final')
    MakeSoundEntity('02_mg_final'):PlaySound(false)
    CompleteMinigame(7)
end

function l_02_Lock:Ignore(bool)
    if bool then
        play_field:IgnoreOnTestPoint('bug_green')
        play_field:IgnoreOnTestPoint('bug_broun')
    else
            play_field:DoNotIgnoreOnTestPoint('bug_broun')
            play_field:DoNotIgnoreOnTestPoint('bug_green')
    end
end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function l_02_Lock:LoadData(screen)
	local anim
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/DT4_MG_02_Lock_Bg.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('DT4_MG_02_Lock_Bg',anim,512,384,10,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/Animation/zamok.png',0,0,180,180,1,0)
	anim:SetHotSpot(90,90)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('zamok',anim,979,306,20,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/Animation/zamok_nakladka.png',0,0,188,268,1,0)
	anim:SetHotSpot(94,134)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('zamok_nakladka',anim,948,305,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/ZhuK_R_[].png',0,0,148,224,12,12)
	anim:SetHotSpot(74,112)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bug_green',anim,928,548,100,0,1,0.9)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/ZhuK_L_[].png',0,0,153,183,12,24)
	anim:SetHotSpot(76,91)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bug_broun',anim,93,546,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('b_arrow_up',anim,81,453,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('b_arrow_down',anim,74,644,100,180,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('b_arrow_right',anim,178,552,100,90,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('b_arrow_left',anim,-26,546,100,270,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('g_arrow_up',anim,926,437,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('g_arrow_right',anim,1028,550,100,90,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('g_arrow_down',anim,935,654,100,180,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/strelka.png',0,0,62,74,1,0)
	anim:SetHotSpot(31,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('g_arrow_left',anim,819,553,100,270,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_tool',anim,511,296,1000,0,126,80)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_1',anim,65,551,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_2',anim,369,550,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_3',anim,373,435,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_4',anim,219,431,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_5',anim,215,304,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_6',anim,222,176,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_7',anim,371,304,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_8',anim,370,174,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_9',anim,508,181,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_10',anim,658,179,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_11',anim,519,550,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_12',anim,663,550,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_13',anim,663,436,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_14',anim,802,436,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_15',anim,802,550,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_16',anim,939,555,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_17',anim,800,307,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_18',anim,653,307,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('area_19',anim,804,145,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_broun',anim,70,549,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_green',anim,939,553,100,0,5.2,6)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/Animation/Krilo_3.png',0,0,72,132,1,0)
	anim:SetHotSpot(17,103)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Krilo_3',anim,514,78,101,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/Animation/Krilo_3_.png',0,0,72,132,1,0)
	anim:SetHotSpot(48,103)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Krilo_3_',anim,496,80,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/shadow_1.png',0,0,130,95,1,0)
	anim:SetHotSpot(65,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sled_broun',anim,85,543,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/shadow_2.png',0,0,109,116,1,0)
	anim:SetHotSpot(54,58)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sled_green',anim,926,548,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/svet_guka_1.png',0,0,130,156,1,0)
	anim:SetHotSpot(65,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('light_broun',anim,87,544,12,270,1,1)
	
	anim = CreateAnimation('data/Texture/Minigames/02_Lock/svet_guka_2.png',0,0,154,146,1,0)
	anim:SetHotSpot(77,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('light_green',anim,926,550,12,90,1,1)
	
end
-- CLEAR_ON_SAVE_END
