local zoom_visitka;
local zoom_hole;

function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/04_Bridge_Bench.lua', 'quest', 'data/Scenes/04_Bridge_Main.lua')
    
    CreateCloudsComposition(screen, 100);
    CreateAmbient(screen, 102);
    CreateLeafes(screen, 104)
    
    play_field:GetObject('gorilla_anim1'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    play_field:GetObject('gorilla_anim1'):GetAnimation():Stop();
    play_field:GetObject('gorilla_anim1'):SetVisible(false);
    
    play_field:GetObject('gorilla_anim2'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    play_field:GetObject('gorilla_anim2'):GetAnimation():Stop();
    play_field:GetObject('gorilla_anim2'):SetVisible(false);
    
    StopMusic("fon_without_rain", false);
    PlayAmbientMusic("fon_without_rain", true);
    
    play_field:GetObject('body' ):SetOpacity(0.0);
    play_field:GetObject('head2'):SetOpacity(0.0);
    play_field:GetObject('layer_dyrka'    ):SetVisible(false);
    play_field:GetObject('lock_part_small'):SetVisible(false);
    play_field:GetObject('area_visitka'   ):SetVisible(false);
    play_field:GetObject('area_hole'      ):SetVisible(false);
    
    play_field:GetObject('kirka'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    play_field:GetObject('kirka'):GetAnimation():Stop();
    play_field:GetObject('kirka'):SetVisible(false);
    
    play_field:GetObject('rat1_anim'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    play_field:GetObject('rat1_anim'):GetAnimation():Stop();
    play_field:GetObject('rat1_anim'):SetVisible(false);
    
    game_state.fretsaw_founded = HasGameState('ToolFound', '04_fretsaw');
    
    zoom_visitka = CreateZoomZone('area_visitka',
                                  'CloseZoneVisitka',
                                  'ZOOM_vizitka', true);
    
    zoom_visitka.on_open = function()
        AddNoteToNotebook('VISITKA');
    end
    
    zoom_visitka.on_close = function()
        zoom_visitka.Disable();
        
        local bankir_comics = CreateComics('04_Bankir',
                                    CreateComicsFrame('Dupen', 'C_04_BANKIR', 'body', 'head2')
                                    );
        if bankir_comics then
            bankir_comics.on_finish = function()
                CompleteLevel('Bridge');
            end
            
            bankir_comics.SetVisible(true);
        end
    end
    
    zoom_hole = CreateZoomZone('area_hole',
                               'CloseZoneHole',
                               'ZOOM_hole', true,
                               'area_lock_part', true,
                               'Worm_anim', true,
                               'lock_part', true);
    
    play_field:GetObject('area_lock_part'):GetAnimation():SetColor('0x01FFFFFF');
    
    RegisterToolFindInfo('04_pick', 'area_pick',                    function(tool_name)
                                                                        play_field:GetObject('area_pick'):SetVisible(false);
                                                                        play_field:GetObject('layer_kirka'):SetVisible(false);
                                                                    end,
                                                                    function(tool_name)
                                                                        play_field:GetObject('area_pick'):SetVisible(false);
                                                                        play_field:GetObject('layer_kirka'):SetVisible(false);
                                                                    end);
    
    RegisterToolApplyInfo('04_pick', 'area_pick_apply', nil, nil,   function(tool_name)
                                                                        play_field:GetObject('layer_dyrka'   ):SetVisible(true);
                                                                        play_field:GetObject('lock_part_small'):SetVisible(true);
                                                                        play_field:GetObject('kirka'         ):SetVisible(true);
                                                                        play_field:GetObject('area_hole'     ):SetVisible(true);
                                                                        play_field:GetObject('area_pick_apply'):SetVisible(false);
                                                                        
                                                                        local anim = play_field:GetObject('kirka'):GetAnimation();
                                                                        local time = GetAnimationLength( anim );
                                                                        
                                                                        anim:Play();
                                                                        PlaySound('04_PickBreak');
                                                                    end,
                                                                    function(tool_name)
                                                                        play_field:GetObject('layer_dyrka'   ):SetVisible(true);
                                                                        play_field:GetObject('lock_part_small'):SetVisible(true);
                                                                        play_field:GetObject('kirka'         ):SetVisible(true);
                                                                        play_field:GetObject('area_hole'     ):SetVisible(true);
                                                                        play_field:GetObject('area_pick_apply'):SetVisible(false);
                                                                        
                                                                        local anim = play_field:GetObject('kirka'):GetAnimation();
                                                                        anim:SetFrame( anim:GetFrames() - 1 );
                                                                    end)
    
    RegisterToolFindInfo('04_lock_part', 'area_lock_part',          function(tool_name)
                                                                        zoom_hole.SetObjectVisible('lock_part', false);
                                                                        play_field:GetObject('lock_part_small'):SetVisible(false);
                                                                        play_field:GetObject('area_lock_part'  ):SetVisible(false);
                                                                        
                                                                        game_state.lock_founded = true;
                                                                        zoom_hole.Disable();
                                                                        
                                                                        AddNoteToNotebook('LOCK_PART');
                                                                    end,
                                                                    function(tool_name)
                                                                        play_field:GetObject('lock_part_small'):SetVisible(false);
                                                                        play_field:GetObject('area_lock_part'  ):SetVisible(false);
                                                                        
                                                                        game_state.lock_founded = true;
                                                                        zoom_hole.Disable();
                                                                    end);
    
    LinkScene('area_ho',
              'CursorGlass',
              'data/Scenes/04_Bridge_Bench_HO.lua',
               true,
               nil,
               nil,
               nil);
    
    if not HasGameState('ActionCompleted', game_state.scene_path.."(gorillaShown)") then
        TimerDoString("PlayGorillaAnimations();", 1, play_field:GetTimer());
    end
    
    PlayAnimationPeriodicallyVsDelay('rat1_anim', 20);
end

function PlayGorillaAnimations()
    local gorilla_1 = play_field:GetObject('gorilla_anim1');
    local time = GetAnimationLength(gorilla_1:GetAnimation());
    
    gorilla_1:GetAnimation():Play();
    gorilla_1:SetVisible(true);
    
    TimerDoString("play_field:GetObject('gorilla_anim1'):SetVisible(false);",   time, play_field:GetTimer());
    TimerDoString("PlayGorillaAnimations_part2();",                             time + 2.5, play_field:GetTimer());
end

function PlayGorillaAnimations_part2()
    local gorilla_2 = play_field:GetObject('gorilla_anim2');
    local time = GetAnimationLength(gorilla_2:GetAnimation());
    
    gorilla_2:GetAnimation():Play();
    gorilla_2:SetVisible(true);
	
	PlaySound('04_Monkey')
    
    TimerDoString("PlayGorillaAnimations_part3();", time, play_field:GetTimer());
end

function PlayGorillaAnimations_part3()
    play_field:GetObject('gorilla_anim2'):SetVisible(false);
    
    AddGameState('ActionCompleted', game_state.scene_path.."(gorillaShown)")
end

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

function OnUpdate(dt)
    if not game_state.area_visitka_visible
        and game_state.fretsaw_founded
        and game_state.lock_founded
    then
        play_field:GetObject('area_visitka'):SetVisible(true);
        game_state.area_visitka_visible = true;
    end
    
    DefaultOnUpdate(dt)
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
    
    if obj_name == 'ZOOM_vizitka' then
        ShowMonolog('C_04_BANKIR_CLOTHES', 'C_04_BANKIR_CLOTHES');
    end
    
    if obj_name == 'area_pick_apply' then
        ShowMonolog('C_04_HINT_PICK', 'C_04_HINT_PICK');
    end

    DefaultOnObjectMouseDownProcessed(is_wrong_click);
end

function OnObjectMouseUp(object)
    DefaultOnObjectMouseUp(object)
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

function CreateAmbient(screen, layer)
    local composition = CreateCompositionSequence();
    local compositionDuration = 10.08;
    composition:SetDuration(compositionDuration);
    composition:AttachTo(screen);
    composition:SetZ(layer);
    composition:SetCyclic(true);
    
    -- Layer Lanterns_13
    local element = CreateCompositionElement("data/Texture/Scenes/04_Bridge/Zone_bench/Layers/Ambient/fonari.png");
    element:SetName("Lanterns_13");
    composition:AddElement(element);
    element:SetHotSpot(512, 121.5);
    element:SetParentElement(composition);
    element:SetXY(512.213897705078, 114.640151977539);
    
    element:SetScaleX(1.01666666666667);
    element:SetScaleY(1.01666666666667);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    effector:SetKey(_TRACK_O, 0, 0.5);
    effector:SetKey(_TRACK_O, 0.05, 0.49001785576669);
    effector:SetKey(_TRACK_O, 0.0666796875, 0.5);
    effector:SetKey(_TRACK_O, 0.1, 0.49285349697841);
    effector:SetKey(_TRACK_O, 0.1333203125, 0.5);
    effector:SetKey(_TRACK_O, 0.15, 0.50778454102724);
    effector:SetKey(_TRACK_O, 0.2, 0.5);
    effector:SetKey(_TRACK_O, 0.25, 0.54295795478698);
    effector:SetKey(_TRACK_O, 0.2666796875, 0.57126072057294);
    effector:SetKey(_TRACK_O, 0.3, 0.53543518532764);
    effector:SetKey(_TRACK_O, 0.3333203125, 0.50000000880083);
    effector:SetKey(_TRACK_O, 0.35, 0.51194778282191);
    effector:SetKey(_TRACK_O, 0.4, 0.53183690908536);
    effector:SetKey(_TRACK_O, 0.45, 0.50956268697891);
    effector:SetKey(_TRACK_O, 0.4666796875, 0.5000000027457);
    effector:SetKey(_TRACK_O, 0.5, 0.51920715407359);
    effector:SetKey(_TRACK_O, 0.5333203125, 0.500000001035);
    effector:SetKey(_TRACK_O, 0.55, 0.48193713684943);
    effector:SetKey(_TRACK_O, 0.6, 0.5);
    effector:SetKey(_TRACK_O, 0.65, 0.50847309077622);
    effector:SetKey(_TRACK_O, 0.6666796875, 0.50000000215964);
    effector:SetKey(_TRACK_O, 0.7, 0.49320541511315);
    effector:SetKey(_TRACK_O, 0.7333203125, 0.50000000041664);
    effector:SetKey(_TRACK_O, 0.75, 0.4897228037615);
    effector:SetKey(_TRACK_O, 0.8, 0.50000000814814);
    effector:SetKey(_TRACK_O, 0.85, 0.51798513672043);
    effector:SetKey(_TRACK_O, 0.8666796875, 0.52730185861894);
    effector:SetKey(_TRACK_O, 0.9, 0.53467516849749);
    effector:SetKey(_TRACK_O, 0.9333203125, 0.50000000470135);
    effector:SetKey(_TRACK_O, 0.95, 0.50614362124658);
    effector:SetKey(_TRACK_O, 1, 0.61705679494613);
    effector:SetKey(_TRACK_O, 1.05, 0.54346777080348);
    effector:SetKey(_TRACK_O, 1.0666796875, 0.50000000198361);
    effector:SetKey(_TRACK_O, 1.1, 0.49244581723146);
    effector:SetKey(_TRACK_O, 1.1333203125, 0.50000000289082);
    effector:SetKey(_TRACK_O, 1.15, 0.48751498325882);
    effector:SetKey(_TRACK_O, 1.2, 0.5);
    effector:SetKey(_TRACK_O, 1.25, 0.64017232132802);
    effector:SetKey(_TRACK_O, 1.2666796875, 0.66727195169214);
    effector:SetKey(_TRACK_O, 1.3, 0.59805240237447);
    effector:SetKey(_TRACK_O, 1.3333203125, 0.5545793049595);
    effector:SetKey(_TRACK_O, 1.35, 0.55487381469229);
    effector:SetKey(_TRACK_O, 1.4, 0.5);
    effector:SetKey(_TRACK_O, 1.45, 0.50216287838937);
    effector:SetKey(_TRACK_O, 1.4666796875, 0.50000000313294);
    effector:SetKey(_TRACK_O, 1.5, 0.55799515145821);
    effector:SetKey(_TRACK_O, 1.5333203125, 0.64313180988895);
    effector:SetKey(_TRACK_O, 1.55, 0.63940492804561);
    effector:SetKey(_TRACK_O, 1.6, 0.50000000873623);
    effector:SetKey(_TRACK_O, 1.65, 0.64993624863455);
    effector:SetKey(_TRACK_O, 1.6666796875, 0.66385387891847);
    effector:SetKey(_TRACK_O, 1.7, 0.5612277167891);
    effector:SetKey(_TRACK_O, 1.7333203125, 0.5000000012631);
    effector:SetKey(_TRACK_O, 1.75, 0.52108350644215);
    effector:SetKey(_TRACK_O, 1.8, 0.58363902706992);
    effector:SetKey(_TRACK_O, 1.85, 0.49469533066105);
    effector:SetKey(_TRACK_O, 1.8666796875, 0.50000000056329);
    effector:SetKey(_TRACK_O, 1.9, 0.51161798602276);
    effector:SetKey(_TRACK_O, 1.9333203125, 0.50000000500696);
    effector:SetKey(_TRACK_O, 1.95, 0.50793789904545);
    effector:SetKey(_TRACK_O, 2, 0.5);
    effector:SetKey(_TRACK_O, 2.05, 0.60950134976048);
    effector:SetKey(_TRACK_O, 2.0666796875, 0.63982360695295);
    effector:SetKey(_TRACK_O, 2.1, 0.55833581945041);
    effector:SetKey(_TRACK_O, 2.1333203125, 0.50000000193881);
    effector:SetKey(_TRACK_O, 2.15, 0.51947625608533);
    effector:SetKey(_TRACK_O, 2.2, 0.52426831873531);
    effector:SetKey(_TRACK_O, 2.25, 0.54185700527148);
    effector:SetKey(_TRACK_O, 2.2666796875, 0.57254250295078);
    effector:SetKey(_TRACK_O, 2.3, 0.55890833607702);
    effector:SetKey(_TRACK_O, 2.3333203125, 0.52084414361676);
    effector:SetKey(_TRACK_O, 2.35, 0.52528315685435);
    effector:SetKey(_TRACK_O, 2.4, 0.51937925351726);
    effector:SetKey(_TRACK_O, 2.45, 0.52248642720775);
    effector:SetKey(_TRACK_O, 2.4666796875, 0.50000000678141);
    effector:SetKey(_TRACK_O, 2.5, 0.52482957787139);
    effector:SetKey(_TRACK_O, 2.5333203125, 0.61719718892576);
    effector:SetKey(_TRACK_O, 2.55, 0.65688749417801);
    effector:SetKey(_TRACK_O, 2.6, 0.66510513641438);
    effector:SetKey(_TRACK_O, 2.65, 0.53795427368271);
    effector:SetKey(_TRACK_O, 2.6666796875, 0.53193457366776);
    effector:SetKey(_TRACK_O, 2.7, 0.55131174179696);
    effector:SetKey(_TRACK_O, 2.7333203125, 0.56431470699263);
    effector:SetKey(_TRACK_O, 2.75, 0.56939319711516);
    effector:SetKey(_TRACK_O, 2.8, 0.55232093264565);
    effector:SetKey(_TRACK_O, 2.85, 0.51250329594422);
    effector:SetKey(_TRACK_O, 2.8666796875, 0.50000000481823);
    effector:SetKey(_TRACK_O, 2.9, 0.56919080377659);
    effector:SetKey(_TRACK_O, 2.9333203125, 0.6744376964629);
    effector:SetKey(_TRACK_O, 2.95, 0.66253681251549);
    effector:SetKey(_TRACK_O, 3, 0.5);
    effector:SetKey(_TRACK_O, 3.05, 0.54261785475256);
    effector:SetKey(_TRACK_O, 3.0666796875, 0.55708182035214);
    effector:SetKey(_TRACK_O, 3.1, 0.52090758298856);
    effector:SetKey(_TRACK_O, 3.1333203125, 0.50000000122989);
    effector:SetKey(_TRACK_O, 3.15, 0.51932361522915);
    effector:SetKey(_TRACK_O, 3.2, 0.5);
    effector:SetKey(_TRACK_O, 3.25, 0.56770859102845);
    effector:SetKey(_TRACK_O, 3.2666796875, 0.60690023583693);
    effector:SetKey(_TRACK_O, 3.3, 0.56154678999098);
    effector:SetKey(_TRACK_O, 3.3333203125, 0.50000000197621);
    effector:SetKey(_TRACK_O, 3.35, 0.53898495494089);
    effector:SetKey(_TRACK_O, 3.4, 0.69243751335185);
    effector:SetKey(_TRACK_O, 3.45, 0.54739369737102);
    effector:SetKey(_TRACK_O, 3.4666796875, 0.50000000551223);
    effector:SetKey(_TRACK_O, 3.5, 0.50850396907594);
    effector:SetKey(_TRACK_O, 3.5333203125, 0.5);
    effector:SetKey(_TRACK_O, 3.55, 0.46886418334715);
    effector:SetKey(_TRACK_O, 3.6, 0.50000000051912);
    effector:SetKey(_TRACK_O, 3.65, 0.48492081654678);
    effector:SetKey(_TRACK_O, 3.6666796875, 0.5000000003403);
    effector:SetKey(_TRACK_O, 3.7, 0.5771220258228);
    effector:SetKey(_TRACK_O, 3.7333203125, 0.63660695287001);
    effector:SetKey(_TRACK_O, 3.75, 0.6328549947005);
    effector:SetKey(_TRACK_O, 3.8, 0.53626819666128);
    effector:SetKey(_TRACK_O, 3.85, 0.57214355205991);
    effector:SetKey(_TRACK_O, 3.8666796875, 0.58365734480979);
    effector:SetKey(_TRACK_O, 3.9, 0.54239254700839);
    effector:SetKey(_TRACK_O, 3.9333203125, 0.53183080680441);
    effector:SetKey(_TRACK_O, 3.95, 0.55015412388577);
    effector:SetKey(_TRACK_O, 4, 0.51857966856899);
    effector:SetKey(_TRACK_O, 4.05, 0.52278865350823);
    effector:SetKey(_TRACK_O, 4.0666796875, 0.50000000309823);
    effector:SetKey(_TRACK_O, 4.1, 0.46452182182263);
    effector:SetKey(_TRACK_O, 4.1333203125, 0.50000000266643);
    effector:SetKey(_TRACK_O, 4.15, 0.53546022156321);
    effector:SetKey(_TRACK_O, 4.2, 0.55593432416761);
    effector:SetKey(_TRACK_O, 4.25, 0.49901232717884);
    effector:SetKey(_TRACK_O, 4.2666796875, 0.50000000051746);
    effector:SetKey(_TRACK_O, 4.3, 0.52726562199521);
    effector:SetKey(_TRACK_O, 4.3333203125, 0.57300027884609);
    effector:SetKey(_TRACK_O, 4.35, 0.57286614254333);
    effector:SetKey(_TRACK_O, 4.4, 0.5);
    effector:SetKey(_TRACK_O, 4.45, 0.54545699781279);
    effector:SetKey(_TRACK_O, 4.4666796875, 0.55210730715912);
    effector:SetKey(_TRACK_O, 4.5, 0.56469844017662);
    effector:SetKey(_TRACK_O, 4.5333203125, 0.61905270831556);
    effector:SetKey(_TRACK_O, 4.55, 0.62739414783822);
    effector:SetKey(_TRACK_O, 4.6, 0.51800592059084);
    effector:SetKey(_TRACK_O, 4.65, 0.50308984657466);
    effector:SetKey(_TRACK_O, 4.6666796875, 0.50000000085448);
    effector:SetKey(_TRACK_O, 4.7, 0.48680823223292);
    effector:SetKey(_TRACK_O, 4.7333203125, 0.50000000121772);
    effector:SetKey(_TRACK_O, 4.75, 0.5183442050642);
    effector:SetKey(_TRACK_O, 4.8, 0.55727103681753);
    effector:SetKey(_TRACK_O, 4.85, 0.51235951644725);
    effector:SetKey(_TRACK_O, 4.8666796875, 0.5);
    effector:SetKey(_TRACK_O, 4.9, 0.51553653823069);
    effector:SetKey(_TRACK_O, 4.9333203125, 0.5);
    effector:SetKey(_TRACK_O, 4.95, 0.51101024815949);
    effector:SetKey(_TRACK_O, 5, 0.68096865905698);
    effector:SetKey(_TRACK_O, 5.05, 0.66836960574797);
    effector:SetKey(_TRACK_O, 5.0666796875, 0.67427900021363);
    effector:SetKey(_TRACK_O, 5.1, 0.66110641195454);
    effector:SetKey(_TRACK_O, 5.1333203125, 0.68247016878692);
    effector:SetKey(_TRACK_O, 5.15, 0.68119420657582);
    effector:SetKey(_TRACK_O, 5.2, 0.50000000599719);
    effector:SetKey(_TRACK_O, 5.25, 0.55146382783273);
    effector:SetKey(_TRACK_O, 5.2666796875, 0.58005005222536);
    effector:SetKey(_TRACK_O, 5.3, 0.55140775915782);
    effector:SetKey(_TRACK_O, 5.3333203125, 0.50000000198859);
    effector:SetKey(_TRACK_O, 5.35, 0.50939198035593);
    effector:SetKey(_TRACK_O, 5.4, 0.58249153437086);
    effector:SetKey(_TRACK_O, 5.45, 0.67877013832236);
    effector:SetKey(_TRACK_O, 5.4666796875, 0.6846858141287);
    effector:SetKey(_TRACK_O, 5.5, 0.58455655448094);
    effector:SetKey(_TRACK_O, 5.5333203125, 0.50000000000207);
    effector:SetKey(_TRACK_O, 5.55, 0.49652546290826);
    effector:SetKey(_TRACK_O, 5.6, 0.50000000063906);
    effector:SetKey(_TRACK_O, 5.65, 0.55681821377354);
    effector:SetKey(_TRACK_O, 5.6666796875, 0.56934415728623);
    effector:SetKey(_TRACK_O, 5.7, 0.60416552787265);
    effector:SetKey(_TRACK_O, 5.7333203125, 0.57458113824587);
    effector:SetKey(_TRACK_O, 5.75, 0.54976113013721);
    effector:SetKey(_TRACK_O, 5.8, 0.62877590258492);
    effector:SetKey(_TRACK_O, 5.85, 0.52722054989581);
    effector:SetKey(_TRACK_O, 5.8666796875, 0.50000000091071);
    effector:SetKey(_TRACK_O, 5.9, 0.48795026163856);
    effector:SetKey(_TRACK_O, 5.9333203125, 0.5);
    effector:SetKey(_TRACK_O, 5.95, 0.51205000500776);
    effector:SetKey(_TRACK_O, 6, 0.51674245751305);
    effector:SetKey(_TRACK_O, 6.05, 0.54977901949166);
    effector:SetKey(_TRACK_O, 6.0666796875, 0.57563097171933);
    effector:SetKey(_TRACK_O, 6.1, 0.58776204078782);
    effector:SetKey(_TRACK_O, 6.1333203125, 0.56822718484452);
    effector:SetKey(_TRACK_O, 6.15, 0.59062215536168);
    effector:SetKey(_TRACK_O, 6.2, 0.6919919431135);
    effector:SetKey(_TRACK_O, 6.25, 0.51206730825166);
    effector:SetKey(_TRACK_O, 6.2666796875, 0.50000000001136);
    effector:SetKey(_TRACK_O, 6.3, 0.55431790553459);
    effector:SetKey(_TRACK_O, 6.3333203125, 0.604123052982);
    effector:SetKey(_TRACK_O, 6.35, 0.63133404576982);
    effector:SetKey(_TRACK_O, 6.4, 0.69315775017548);
    effector:SetKey(_TRACK_O, 6.45, 0.50612680472064);
    effector:SetKey(_TRACK_O, 6.4666796875, 0.50000000339159);
    effector:SetKey(_TRACK_O, 6.5, 0.56828704819586);
    effector:SetKey(_TRACK_O, 6.5333203125, 0.56524858078026);
    effector:SetKey(_TRACK_O, 6.55, 0.55184416733995);
    effector:SetKey(_TRACK_O, 6.6, 0.62223884573656);
    effector:SetKey(_TRACK_O, 6.65, 0.51069422784566);
    effector:SetKey(_TRACK_O, 6.6666796875, 0.50000000032236);
    effector:SetKey(_TRACK_O, 6.7, 0.54339352334988);
    effector:SetKey(_TRACK_O, 6.7333203125, 0.53758659816424);
    effector:SetKey(_TRACK_O, 6.75, 0.51387975265807);
    effector:SetKey(_TRACK_O, 6.8, 0.5);
    effector:SetKey(_TRACK_O, 6.85, 0.57987863022649);
    effector:SetKey(_TRACK_O, 6.8666796875, 0.60469680071084);
    effector:SetKey(_TRACK_O, 6.9, 0.62500499136137);
    effector:SetKey(_TRACK_O, 6.9333203125, 0.65344096453164);
    effector:SetKey(_TRACK_O, 6.95, 0.67743094844882);
    effector:SetKey(_TRACK_O, 7, 0.68019348735008);
    effector:SetKey(_TRACK_O, 7.05, 0.53728920174048);
    effector:SetKey(_TRACK_O, 7.0666796875, 0.5);
    effector:SetKey(_TRACK_O, 7.1, 0.58982386508576);
    effector:SetKey(_TRACK_O, 7.1333203125, 0.68902554399243);
    effector:SetKey(_TRACK_O, 7.15, 0.66373422358569);
    effector:SetKey(_TRACK_O, 7.2, 0.50000000417768);
    effector:SetKey(_TRACK_O, 7.25, 0.61160251773949);
    effector:SetKey(_TRACK_O, 7.2666796875, 0.64213690681071);
    effector:SetKey(_TRACK_O, 7.3, 0.55822312122964);
    effector:SetKey(_TRACK_O, 7.3333203125, 0.50000000034829);
    effector:SetKey(_TRACK_O, 7.35, 0.52848115752222);
    effector:SetKey(_TRACK_O, 7.4, 0.59666433182043);
    effector:SetKey(_TRACK_O, 7.45, 0.51689105530819);
    effector:SetKey(_TRACK_O, 7.4666796875, 0.5);
    effector:SetKey(_TRACK_O, 7.5, 0.51106617028939);
    effector:SetKey(_TRACK_O, 7.5333203125, 0.50000000048949);
    effector:SetKey(_TRACK_O, 7.55, 0.49392808503114);
    effector:SetKey(_TRACK_O, 7.6, 0.5);
    effector:SetKey(_TRACK_O, 7.65, 0.49658396460567);
    effector:SetKey(_TRACK_O, 7.6666796875, 0.50000000344167);
    effector:SetKey(_TRACK_O, 7.7, 0.50762791824923);
    effector:SetKey(_TRACK_O, 7.7333203125, 0.5);
    effector:SetKey(_TRACK_O, 7.75, 0.51745640183856);
    effector:SetKey(_TRACK_O, 7.8, 0.66546526427351);
    effector:SetKey(_TRACK_O, 7.85, 0.56525602585958);
    effector:SetKey(_TRACK_O, 7.8666796875, 0.57603991944525);
    effector:SetKey(_TRACK_O, 7.9, 0.55192210301294);
    effector:SetKey(_TRACK_O, 7.9333203125, 0.50000000408158);
    effector:SetKey(_TRACK_O, 7.95, 0.51176058787145);
    effector:SetKey(_TRACK_O, 8, 0.5);
    effector:SetKey(_TRACK_O, 8.05, 0.50592365001546);
    effector:SetKey(_TRACK_O, 8.0666796875, 0.50000000189607);
    effector:SetKey(_TRACK_O, 8.1, 0.58484839282048);
    effector:SetKey(_TRACK_O, 8.1333203125, 0.67698905146208);
    effector:SetKey(_TRACK_O, 8.15, 0.63805846276502);
    effector:SetKey(_TRACK_O, 8.2, 0.5);
    effector:SetKey(_TRACK_O, 8.25, 0.49188504676298);
    effector:SetKey(_TRACK_O, 8.2666796875, 0.50000000721467);
    effector:SetKey(_TRACK_O, 8.3, 0.53067946634051);
    effector:SetKey(_TRACK_O, 8.3333203125, 0.5);
    effector:SetKey(_TRACK_O, 8.35, 0.5010404929135);
    effector:SetKey(_TRACK_O, 8.4, 0.64297311319315);
    effector:SetKey(_TRACK_O, 8.45, 0.5442709963852);
    effector:SetKey(_TRACK_O, 8.4666796875, 0.5);
    effector:SetKey(_TRACK_O, 8.5, 0.48358013829015);
    effector:SetKey(_TRACK_O, 8.5333203125, 0.51664479506821);
    effector:SetKey(_TRACK_O, 8.55, 0.52543069192926);
    effector:SetKey(_TRACK_O, 8.6, 0.58917508532182);
    effector:SetKey(_TRACK_O, 8.65, 0.49970663513273);
    effector:SetKey(_TRACK_O, 8.6666796875, 0.50000000035082);
    effector:SetKey(_TRACK_O, 8.7, 0.5252816464467);
    effector:SetKey(_TRACK_O, 8.7333203125, 0.51677297440535);
    effector:SetKey(_TRACK_O, 8.75, 0.53563853998162);
    effector:SetKey(_TRACK_O, 8.8, 0.62771385845515);
    effector:SetKey(_TRACK_O, 8.85, 0.6001382499992);
    effector:SetKey(_TRACK_O, 8.8666796875, 0.57695547650716);
    effector:SetKey(_TRACK_O, 8.9, 0.53931703228542);
    effector:SetKey(_TRACK_O, 8.9333203125, 0.5000000039972);
    effector:SetKey(_TRACK_O, 8.95, 0.48695516942971);
    effector:SetKey(_TRACK_O, 9, 0.57148045563799);
    effector:SetKey(_TRACK_O, 9.05, 0.51168407424193);
    effector:SetKey(_TRACK_O, 9.0666796875, 0.50000000498741);
    effector:SetKey(_TRACK_O, 9.1, 0.51511566299069);
    effector:SetKey(_TRACK_O, 9.1333203125, 0.50000000121229);
    effector:SetKey(_TRACK_O, 9.15, 0.48849786150428);
    effector:SetKey(_TRACK_O, 9.2, 0.5);
    effector:SetKey(_TRACK_O, 9.25, 0.62644591172353);
    effector:SetKey(_TRACK_O, 9.2666796875, 0.67100132001897);
    effector:SetKey(_TRACK_O, 9.3, 0.65424409072808);
    effector:SetKey(_TRACK_O, 9.3333203125, 0.61542711509607);
    effector:SetKey(_TRACK_O, 9.35, 0.60130730200292);
    effector:SetKey(_TRACK_O, 9.4, 0.5);
    effector:SetKey(_TRACK_O, 9.45, 0.48166522520968);
    effector:SetKey(_TRACK_O, 9.4666796875, 0.5000000009969);
    effector:SetKey(_TRACK_O, 9.5, 0.54243091559715);
    effector:SetKey(_TRACK_O, 9.5333203125, 0.56743370014736);
    effector:SetKey(_TRACK_O, 9.55, 0.56541643385681);
    effector:SetKey(_TRACK_O, 9.6, 0.51619922818873);
    effector:SetKey(_TRACK_O, 9.65, 0.58786400979174);
    effector:SetKey(_TRACK_O, 9.6666796875, 0.59634083568831);
    effector:SetKey(_TRACK_O, 9.7, 0.54460757210619);
    effector:SetKey(_TRACK_O, 9.7333203125, 0.50000000098866);
    effector:SetKey(_TRACK_O, 9.75, 0.53378651679636);
    effector:SetKey(_TRACK_O, 9.8, 0.61164891973113);
    effector:SetKey(_TRACK_O, 9.85, 0.53294013117055);
    effector:SetKey(_TRACK_O, 9.8666796875, 0.50000000056594);
    effector:SetKey(_TRACK_O, 9.9, 0.55640996054136);
    effector:SetKey(_TRACK_O, 9.9333203125, 0.67728202154607);
    effector:SetKey(_TRACK_O, 9.95, 0.66755948580126);
    effector:SetKey(_TRACK_O, 10, 0.55255897701956);
    effector:SetKey(_TRACK_O, 10.04, 0.5);
    
    effector:Play();
    
    
    -- Layer BG_14
    local element = CreateCompositionElement("data/Texture/Scenes/04_Bridge/Zone_bench/Layers/Ambient/zoom1.png");
    element:SetName("BG_14");
    composition:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(composition);
    element:SetXY(512, 384);
    
    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);
    element:SetOpacity(1);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    
    effector:Play();
end

function CreateCloudsComposition(screen, layer)
    local composition = CreateCompositionSequence();
    local compositionDuration = 10.08;
    composition:SetDuration(compositionDuration);
    composition:AttachTo(screen);
    composition:SetZ(layer);
    composition:SetCyclic(true);
    
    -- Layer Flash_15
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/lighting_04.png");
    element:SetName("Flash_15");
    composition:AddElement(element);
    element:SetHotSpot(171, 167.5);
    element:SetParentElement(composition);
    element:SetXY(243.704162597656, 144.203598022461);
    
    element:SetScaleX(1.29741272783392);
    element:SetScaleY(1.29741272783392);
    element:SetAngle(-0.51257387658254);
    
    effector = element:GetEffector();
    effector:SetLifeTime(6.32, 6.64);
    
    effector:SetKey(_TRACK_O, 6.32, 0);
    effector:SetKey(_TRACK_O, 6.4, 1);
    effector:SetKey(_TRACK_O, 6.6, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_lighting_16
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2_lighting.png");
    element:SetName("Cloud_lighting_16");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetXY(123.17741394043, 113.50944519043);
    
    element:SetScaleX(0.30568677507076);
    element:SetScaleY(0.30568677507076);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(6.32, 6.72);
    
    effector:SetKey(_TRACK_O, 6.32, 0);
    effector:SetKey(_TRACK_O, 6.4, 1);
    effector:SetKey(_TRACK_O, 6.68, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_17
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud1.png");
    element:SetName("Cloud_17");
    composition:AddElement(element);
    element:SetHotSpot(790, 383);
    element:SetParentElement(composition);
    element:SetScaleX(0.57202193746264);
    element:SetScaleY(0.57202193746264);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(5.04, 10.08);
    
    effector:SetKey(_TRACK_X, 5.04, 226.898170936747);
    effector:SetKey(_TRACK_Y, 5.04, 349);
    effector:SetKey(_TRACK_X, 10.04, 316.590203410257);
    effector:SetKey(_TRACK_Y, 10.04, 349);
    effector:SetKey(_TRACK_X, 15.08, 407);
    effector:SetKey(_TRACK_Y, 15.08, 349);
    effector:SetKey(_TRACK_O, 5.04, 0);
    effector:SetKey(_TRACK_O, 10.04, 1);
    effector:SetKey(_TRACK_O, 15.08, 0);
    
    effector:Play();
    
    
    -- Layer Flash_18
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/lighting_04.png");
    element:SetName("Flash_18");
    composition:AddElement(element);
    element:SetHotSpot(171, 167.5);
    element:SetParentElement(composition);
    element:SetXY(580.272689819336, 179.289901733398);
    
    element:SetScaleX(-1.18903573554844);
    element:SetScaleY(1.29741272783392);
    element:SetAngle(-0.27824904979082);
    
    effector = element:GetEffector();
    effector:SetLifeTime(7.2, 7.52);
    
    effector:SetKey(_TRACK_O, 7.2, 0);
    effector:SetKey(_TRACK_O, 7.28, 1);
    effector:SetKey(_TRACK_O, 7.48, 0);
    
    effector:Play();
    
    
    -- Layer Flash_19
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/lighting_04.png");
    element:SetName("Flash_19");
    composition:AddElement(element);
    element:SetHotSpot(171, 167.5);
    element:SetParentElement(composition);
    element:SetXY(498.404678344727, 172.792434692383);
    
    element:SetScaleX(-1.18903573554844);
    element:SetScaleY(1.29741272783392);
    element:SetAngle(0.19982876324502);
    
    effector = element:GetEffector();
    effector:SetLifeTime(7.12, 7.44);
    
    effector:SetKey(_TRACK_O, 7.12, 0);
    effector:SetKey(_TRACK_O, 7.2, 1);
    effector:SetKey(_TRACK_O, 7.4, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_20
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud1.png");
    element:SetName("Cloud_20");
    composition:AddElement(element);
    element:SetHotSpot(790, 383);
    element:SetParentElement(composition);
    element:SetScaleX(0.57202193746264);
    element:SetScaleY(0.57202193746264);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 5.08);
    
    effector:SetKey(_TRACK_X, 0, 316.5905);
    effector:SetKey(_TRACK_Y, 0, 349);
    effector:SetKey(_TRACK_X, 5.04, 407);
    effector:SetKey(_TRACK_Y, 5.04, 349);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 5.04, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_21
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud1.png");
    element:SetName("Cloud_21");
    composition:AddElement(element);
    element:SetHotSpot(790, 383);
    element:SetParentElement(composition);
    element:SetScaleX(0.57202193746264);
    element:SetScaleY(0.57202193746264);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    effector:SetKey(_TRACK_X, 0, 226.898170936747);
    effector:SetKey(_TRACK_Y, 0, 349);
    effector:SetKey(_TRACK_X, 10.04, 407);
    effector:SetKey(_TRACK_Y, 10.04, 349);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 5, 1);
    effector:SetKey(_TRACK_O, 10.04, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_22
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2.png");
    element:SetName("Cloud_22");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetScaleX(0.32257345571483);
    element:SetScaleY(0.32257345571483);
    element:SetAngle(-0.00280331340704);
    
    effector = element:GetEffector();
    effector:SetLifeTime(5.04, 10.08);
    
    effector:SetKey(_TRACK_X, 5.04, 465.345000431401);
    effector:SetKey(_TRACK_Y, 5.04, 186.720094598897);
    effector:SetKey(_TRACK_X, 10.04, 489.245725404883);
    effector:SetKey(_TRACK_Y, 10.04, 186.720094598897);
    effector:SetKey(_TRACK_X, 15.08, 513.345000431401);
    effector:SetKey(_TRACK_Y, 15.08, 186.720094598897);
    effector:SetKey(_TRACK_O, 5.04, 0);
    effector:SetKey(_TRACK_O, 10.04, 1);
    effector:SetKey(_TRACK_O, 15.08, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_23
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2.png");
    element:SetName("Cloud_23");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetScaleX(0.32257345571483);
    element:SetScaleY(0.32257345571483);
    element:SetAngle(-0.00280331340704);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 5.08);
    
    effector:SetKey(_TRACK_X, 0, 489.2457);
    effector:SetKey(_TRACK_Y, 0, 186.720094598897);
    effector:SetKey(_TRACK_X, 5.04, 513.345000431401);
    effector:SetKey(_TRACK_Y, 5.04, 186.720094598897);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 5.04, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_24
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2.png");
    element:SetName("Cloud_24");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetScaleX(0.32257345571483);
    element:SetScaleY(0.32257345571483);
    element:SetAngle(-0.00280331340704);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    effector:SetKey(_TRACK_X, 0, 465.345000431401);
    effector:SetKey(_TRACK_Y, 0, 186.720094598897);
    effector:SetKey(_TRACK_X, 10.04, 513.345000431401);
    effector:SetKey(_TRACK_Y, 10.04, 186.720094598897);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 5, 1);
    effector:SetKey(_TRACK_O, 10.04, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_25
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2.png");
    element:SetName("Cloud_25");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetScaleX(0.458);
    element:SetScaleY(0.458);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(5, 10.08);
    
    effector:SetKey(_TRACK_X, 5, 378.396598568038);
    effector:SetKey(_TRACK_Y, 5, 159);
    effector:SetKey(_TRACK_X, 10.04, 430.404585540787);
    effector:SetKey(_TRACK_Y, 10.04, 159);
    effector:SetKey(_TRACK_X, 15.04, 482);
    effector:SetKey(_TRACK_Y, 15.04, 159);
    effector:SetKey(_TRACK_O, 5, 0);
    effector:SetKey(_TRACK_O, 10, 1);
    effector:SetKey(_TRACK_O, 15.04, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_lighting_26
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2_lighting.png");
    element:SetName("Cloud_lighting_26");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetXY(632.578430175781, 121.306411743164);
    
    element:SetScaleX(-0.34795789498);
    element:SetScaleY(0.30568677507076);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(7.12, 7.52);
    
    effector:SetKey(_TRACK_O, 7.12, 0);
    effector:SetKey(_TRACK_O, 7.2, 1);
    effector:SetKey(_TRACK_O, 7.48, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_27
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2.png");
    element:SetName("Cloud_27");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetScaleX(0.458);
    element:SetScaleY(0.458);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 5.04);
    
    effector:SetKey(_TRACK_X, 0, 430.4046);
    effector:SetKey(_TRACK_Y, 0, 159);
    effector:SetKey(_TRACK_X, 5, 482);
    effector:SetKey(_TRACK_Y, 5, 159);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 5, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_28
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2.png");
    element:SetName("Cloud_28");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetScaleX(0.458);
    element:SetScaleY(0.458);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    effector:SetKey(_TRACK_X, 0, 378.396598568038);
    effector:SetKey(_TRACK_Y, 0, 159);
    effector:SetKey(_TRACK_X, 10.04, 482);
    effector:SetKey(_TRACK_Y, 10.04, 159);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 5, 1);
    effector:SetKey(_TRACK_O, 10.04, 0);
    
    effector:Play();
    
    
    -- Layer Moon_29
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/moon.png");
    element:SetName("Moon_29");
    composition:AddElement(element);
    element:SetHotSpot(315, 315);
    element:SetParentElement(composition);
    element:SetXY(624.838882446289, 103.016738891602);
    
    element:SetScaleX(0.17398608111351);
    element:SetScaleY(0.17398608111351);
    element:SetAngle(0);
    element:SetOpacity(1);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    
    effector:Play();
    
    
    -- Layer Back_30
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/back1.jpg");
    element:SetName("Back_30");
    composition:AddElement(element);
    element:SetHotSpot(654, 412.5);
    element:SetParentElement(composition);
    element:SetScaleX(0.93251968503937);
    element:SetScaleY(0.84251968503937);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 5.2);
    
    effector:SetKey(_TRACK_X, 0, 480.7443);
    effector:SetKey(_TRACK_Y, 0, 326.155789555475);
    effector:SetKey(_TRACK_X, 5.16, 521.851642518532);
    effector:SetKey(_TRACK_Y, 5.16, 326.155789555475);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 5.16, 0);
    
    effector:Play();
    
    
    -- Layer Back_31
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/back1.jpg");
    element:SetName("Back_31");
    composition:AddElement(element);
    element:SetHotSpot(654, 412.5);
    element:SetParentElement(composition);
    element:SetScaleX(0.93251968503937);
    element:SetScaleY(0.84251968503937);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(5.16, 10.08);
    
    effector:SetKey(_TRACK_X, 5.16, 441.851642518532);
    effector:SetKey(_TRACK_Y, 5.16, 326.155789555475);
    effector:SetKey(_TRACK_X, 10.04, 480.744327573196);
    effector:SetKey(_TRACK_Y, 10.04, 326.155789555475);
    effector:SetKey(_TRACK_X, 15.2, 521.851642518532);
    effector:SetKey(_TRACK_Y, 15.2, 326.155789555475);
    effector:SetKey(_TRACK_O, 5.16, 0);
    effector:SetKey(_TRACK_O, 10.04, 1);
    effector:SetKey(_TRACK_O, 15.2, 0);
    
    effector:Play();
    
    
    -- Layer Back_32
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/back1.jpg");
    element:SetName("Back_32");
    composition:AddElement(element);
    element:SetHotSpot(654, 412.5);
    element:SetParentElement(composition);
    element:SetScaleX(0.93251968503937);
    element:SetScaleY(0.84251968503937);
    element:SetAngle(0);
    element:SetOpacity(1);
    
    effector = element:GetEffector();
    effector:SetLifeTime(0, 10.08);
    
    effector:SetKey(_TRACK_X, 0, 441.851642518532);
    effector:SetKey(_TRACK_Y, 0, 326.155789555475);
    effector:SetKey(_TRACK_X, 10.04, 521.851642518532);
    effector:SetKey(_TRACK_Y, 10.04, 326.155789555475);
    
    effector:Play();
    
    
    -- Layer Cloud_lighting_33
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2_lighting.png");
    element:SetName("Cloud_lighting_33");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetXY(186, 298);
    
    element:SetScaleX(1.03);
    element:SetScaleY(1.03);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(7.56, 7.96);
    
    effector:SetKey(_TRACK_O, 7.56, 0);
    effector:SetKey(_TRACK_O, 7.64, 1);
    effector:SetKey(_TRACK_O, 7.92, 0);
    
    effector:Play();
    
    
    -- Layer Flash_34
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/lighting_04.png");
    element:SetName("Flash_34");
    composition:AddElement(element);
    element:SetHotSpot(171, 167.5);
    element:SetParentElement(composition);
    element:SetXY(701.240219116211, 386.628311157227);
    
    element:SetScaleX(1.6904287596923);
    element:SetScaleY(1.6904287596923);
    element:SetAngle(1.13863919750427);
    
    effector = element:GetEffector();
    effector:SetLifeTime(7.8, 8.12);
    
    effector:SetKey(_TRACK_O, 7.8, 0);
    effector:SetKey(_TRACK_O, 7.88, 1);
    effector:SetKey(_TRACK_O, 8.08, 0);
    
    effector:Play();
    
    
    -- Layer Cloud_lighting_35
    local element = CreateCompositionElement("data/Texture/Scenes/Common/Ambient/cloud2_lighting.png");
    element:SetName("Cloud_lighting_35");
    composition:AddElement(element);
    element:SetHotSpot(1000, 444);
    element:SetParentElement(composition);
    element:SetXY(898, 224);
    
    element:SetScaleX(1.03);
    element:SetScaleY(1.03);
    element:SetAngle(0);
    
    effector = element:GetEffector();
    effector:SetLifeTime(7.8, 8.2);
    
    effector:SetKey(_TRACK_O, 7.8, 0);
    effector:SetKey(_TRACK_O, 7.88, 1);
    effector:SetKey(_TRACK_O, 8.16, 0);
    
    effector:Play();
    
    composition:Play();
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/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('background',anim,512,384,99,0,128,96)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Layers/zoom_vizitka.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ZOOM_vizitka',anim,512,384,130,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_visitka',anim,582,457,103,0,15,15)
	local anim = CreateAnimation('data/Texture/Characters/Dupen/body.png',0,0,376,520,1,0)
	anim:SetHotSpot(188,260)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('body',anim,315,508,111,0,1,1)
	local anim = CreateAnimation('data/Texture/Characters/Dupen/head2.png',0,0,214,252,1,0)
	anim:SetHotSpot(107,126)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('head2',anim,344,200,112,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_ho',anim,944,569,106,0,13,20)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Layers/layer_kirka.png',0,0,119,164,1,0)
	anim:SetHotSpot(59,82)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_kirka',anim,404,416,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Layers/layer_musorka_over.jpg',0,0,52,113,1,0)
	anim:SetHotSpot(26,56)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_musorka_over',anim,442,453,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_pick',anim,404,365,106,0,13,10)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_pick_apply',anim,247,523,107,0,1,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_hole',anim,247,523,107,0,1,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_lock_part',anim,521,440,153,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Animations/kirka.png',0,0,221,184,15,25)
	anim:SetHotSpot(110,92)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('kirka',anim,261,518,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Layers/layer_dyrka.png',0,0,117,51,1,0)
	anim:SetHotSpot(58,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_dyrka',anim,243,524,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Zoom_hole/ZOOM_hole.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ZOOM_hole',anim,512,384,150,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Gendarmery/Zone_wart/Animations/rat1_anim.png',0,0,389,109,44,25)
	anim:SetHotSpot(194,54)
	anim:SetBlendMode(3)
	anim:SetColor('0xEE222222')
	screen:CreateObject('rat1_anim',anim,53,443,103,0,0.6,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/05_Gendarmery/Zone_wart/Animations/fly_anim.png',0,0,217,217,8,10)
	anim:SetHotSpot(108,108)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fly_anim',anim,161,51,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Zoom_hole/Animation/Worm_anim.png',0,0,240,180,9,9)
	anim:SetHotSpot(120,90)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Worm_anim',anim,475,403,152,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Zoom_hole/lock_part.png',0,0,48,53,1,0)
	anim:SetHotSpot(24,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lock_part',anim,526,439,151,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Layers/lock_part_small.png',0,0,14,16,1,0)
	anim:SetHotSpot(7,8)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lock_part_small',anim,242,534,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Animations/gorilla_anim1.png',0,0,157,49,4,12)
	anim:SetHotSpot(78,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('gorilla_anim1',anim,479,326,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Bridge/Zone_bench/Animations/gorilla_anim2.png',0,0,228,98,5,8)
	anim:SetHotSpot(114,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('gorilla_anim2',anim,818,330,103,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
