--// Local auxiliary functions - - - - - - - - - - - - - - - - - - - - - - - -

--// 1.	rename:					" -> '
--// 2. comment root composition routine 'createCompositionBG_Zone_2_inside_Temple_Floor2 = function()'
--// 3. add auxiliaru routines for managing animations: auxPlayDinoTopAnimation(), auxGetDinoTopAnimation(), auxCreateDinoTopAnimations()
--// 4. adjust life-time for sprites in 'createCompositionsvet_cycle' composition

------------------------------------------------------------------------------
--
function auxPlayDinoTopAnimation(compositionName)
    local composition = auxGetDinoTopAnimation(compositionName);
    composition:SetVisible(true);
    composition:Play();
end

------------------------------------------------------------------------------
--
function auxGetDinoTopAnimation(compositionName)
    assert(l3topCompositions ~= nil and compositionName ~= nil);
	assert(l3topCompositions[compositionName] ~= nil and 'Composition with specified name not exists !');

    return l3topCompositions[compositionName];
end

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--
function CreateComposition(parent, compositionRoutine, name, x,y,z, hotSpotX,hotSpotY, duration, isCyclic)
    assert(parent ~= nil and compositionRoutine ~= nil and name ~= nil and z ~= nil and duration ~= nil);

    local element = compositionRoutine();
    element:SetName(name);
    element:SetHotSpot(hotSpotX,hotSpotY);
    element:SetXY(x, y);
    assert(z - parent:GetZ());
    element:SetZ(z - parent:GetZ());
    element:AttachTo(parent);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);
    element:SetOpacity(1);
    
    if (isCyclic == true) then
        element:SetDuration(duration);
        element:SetCyclic(true);
	else
		element:SetDestroysOnEnd(false);
    end
	element:Stop();
    element:SetVisible(false);
    element:AssignClippingRect(parent);
	element:SetConsiderParentOpacity(true);

	return element;
end

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxCreateCompositionElement(resourceName)
	local element = CreateCompositionElement(resourceName);
    local texName = string.sub(resourceName, string.len('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/') + 1);

	--// set up flies animation
	if (texName == 'Env/Bug_fly[01-02].png') then
		local anim = element:GetTexture();
		anim:Stop();
		anim:SetTextureRect(0,0, 19,18);
		anim:SetFrames(2);
		anim:SetFrame(0);
		anim:SetSpeed(30.0);
		anim:SetMode(HGEANIM_FWD + HGEANIM_LOOP);
		anim:Play();
    end
    --// set up hummingbirds animation
	if (texName == 'Env/Colibri_[01-02].png') then
		local anim = element:GetTexture();
		anim:Stop();
		anim:SetTextureRect(0,0, 107,64);
		anim:SetFrames(2);
		anim:SetFrame(0);
		anim:SetSpeed(30.0);
		anim:SetMode(HGEANIM_FWD + HGEANIM_LOOP);
		anim:Play();
    end

    --// set additive alpha blending mode for light & flare objects without alpha chanel (*.jpg)
    if (texName == 'Env/EF_Dust_01.jpg' or
		texName == 'Env/EF_light02.jpg' or
		texName == 'Env/EF_Light03.jpg' or
        texName == 'Env/EF_Light01.jpg') then

        element:GetTexture():SetBlendMode(0);
    end
	return element;
end

------------------------------------------------------------------------------
--
function auxCreateDinoTopAnimations(parent)
    assert(parent ~= nil);
    l3topCompositions = {};
    
    local CreateAndRegisterComposition = function (parent, compositionRoutine, name, x,y,z, hotSpotX,hotSpotY, duration, isCyclic)
        local element = CreateComposition(parent, compositionRoutine, name, x,y,z, hotSpotX,hotSpotY, duration, isCyclic);
        l3topCompositions[element:GetName()] = element;
    end
    
    CreateAndRegisterComposition(parent, createCompositiondyno_1, 'Dino1', 90,40,201.0, 476,412, 10, true);
    CreateAndRegisterComposition(parent, createCompositiondyno_1, 'Dino2', 40,40,201.0, 579,400, 10, true);
	do
		local dino1 = l3topCompositions['Dino1'];
		local dino2 = l3topCompositions['Dino2'];
		assert(dino1 ~= nil);
	    dino1:SetScaleX(-0.730469);
	    dino1:SetScaleY(0.73046875);

		dino1:SetSpeed(0.4);
		dino2:SetSpeed(0.5);
	end
    CreateAndRegisterComposition(parent, createCompositionpalmTwig,   'TwigAnimation', 0,0,208.0, 512,384, 6.25, true);
--    CreateAndRegisterComposition(parent, createCompositiondust_cycle, 'Dust', 0,0,209.0, 512,384, 10.79166, true);
--    CreateAndRegisterComposition(parent, createCompositionsvet_cycle, 'Light', 0,0,210.0, 580,362, 2, true);
	--// Env2
    CreateAndRegisterComposition(parent, createCompositionEnvTop2,		'EnvTop2',		0,0,210, 512,384, 10, true);
    CreateAndRegisterComposition(parent, createCompositionL2Fly,		'L2Fly',		0,0,209, 512,384, 10, false);
    CreateAndRegisterComposition(parent, createCompositionHummingBird1,	'HummingBird1',	0,0,209, 512,384, 10, false);
    CreateAndRegisterComposition(parent, createCompositionHummingBird2,	'HummingBird2',	0,0,209, 512,384, 10, false);
end

------------------------------------------------------------------------------
-- (!) ROOT
--createCompositionBG_Zone_2_inside_Temple_Floor2 = function()
--
--    local compositionBG_Zone_2_inside_Temple_Floor2 = CreateCompositionSequence();
--    local compositionDuration = 10.8;
--    compositionBG_Zone_2_inside_Temple_Floor2:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = createCompositionpalmTwig();
--    element:SetName('Layer_1');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 6.25);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_2
--    local element = createCompositionsvet_cycle();
--    element:SetName('Layer_2');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(580, 362);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 2);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_3
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/bg_mask.png');
--    element:SetName('Layer_3');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(271.5, 168);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(631, 378);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 2);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_4
--    local element = createCompositiondust_cycle();
--    element:SetName('Layer_4');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10.7916666666667);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_5
--    local element = createCompositiondyno_1();
--    element:SetName('Layer_5');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(476, 412);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_6
--    local element = createCompositiondyno_1();
--    element:SetName('Layer_6');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(579, 400);
--
--    element:SetScaleX(-0.730469);
--    element:SetScaleY(0.73046875);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_7
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/BG_Zone_2_inside_Temple_Floor2.jpg');
--    element:SetName('Layer_7');
--    compositionBG_Zone_2_inside_Temple_Floor2:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionBG_Zone_2_inside_Temple_Floor2);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 2);
--
--
--    effector:Play();
--
--    compositionBG_Zone_2_inside_Temple_Floor2:Play();
--
--    return compositionBG_Zone_2_inside_Temple_Floor2;
--end

--createCompositiondust_cycle = function()
--
--    local compositiondust_cycle = CreateCompositionSequence();
--    local compositionDuration = 10.84;
--    compositiondust_cycle:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/dust.png');
--    element:SetName('Layer_1');
--    compositiondust_cycle:AddElement(element);
--    element:SetHotSpot(514, 514);
--    element:SetParentElement(compositiondust_cycle);
--    element:SetXY(514, 254);
--
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 1.66);
--
--    effector:SetKey(_TRACK_SX, -5.48, 1);
--    effector:SetKey(_TRACK_SY, -5.48, 1);
--    effector:SetKey(_TRACK_SX, 1.64, 1.38);
--    effector:SetKey(_TRACK_SY, 1.64, 1.38);
--    effector:SetKey(_TRACK_O, -5.48, 0);
--    effector:SetKey(_TRACK_O, -3.84, 1);
--    effector:SetKey(_TRACK_O, -0.04, 1);
--    effector:SetKey(_TRACK_O, 1.64, 0);
--
--    effector:Play();
--
--
--    -- Layer Layer_2
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/dust.png');
--    element:SetName('Layer_2');
--    compositiondust_cycle:AddElement(element);
--    element:SetHotSpot(514, 514);
--    element:SetParentElement(compositiondust_cycle);
--    element:SetXY(514, 254);
--
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(5.36, 10.84);
--
--    effector:SetKey(_TRACK_SX, 5.36, 1);
--    effector:SetKey(_TRACK_SY, 5.36, 1);
--    effector:SetKey(_TRACK_SX, 10.8, 1.29033707865169);
--    effector:SetKey(_TRACK_SY, 10.8, 1.29033707865169);
--    effector:SetKey(_TRACK_O, 5.36, 0);
--    effector:SetKey(_TRACK_O, 7, 1);
--    effector:SetKey(_TRACK_O, 10.8, 1);
--
--    effector:Play();
--
--
--    -- Layer Layer_3
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/dust.png');
--    element:SetName('Layer_3');
--    compositiondust_cycle:AddElement(element);
--    element:SetHotSpot(514, 514);
--    element:SetParentElement(compositiondust_cycle);
--    element:SetXY(514, 254);
--
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 7.14);
--
--    effector:SetKey(_TRACK_SX, 0, 1);
--    effector:SetKey(_TRACK_SY, 0, 1);
--    effector:SetKey(_TRACK_SX, 7.12, 1.38);
--    effector:SetKey(_TRACK_SY, 7.12, 1.38);
--    effector:SetKey(_TRACK_O, 0, 0);
--    effector:SetKey(_TRACK_O, 1.64, 1);
--    effector:SetKey(_TRACK_O, 5.44, 1);
--    effector:SetKey(_TRACK_O, 7.12, 0);
--
--    effector:Play();
--
--    compositiondust_cycle:Play();
--
--    return compositiondust_cycle;
--end

--createCompositionFire_dust_cycle = function()
--
--    local compositionFire_dust_cycle = CreateCompositionSequence();
--    local compositionDuration = 3.8;
--    compositionFire_dust_cycle:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/fire_dust.png');
--    element:SetName('Layer_1');
--    compositionFire_dust_cycle:AddElement(element);
--    element:SetHotSpot(16, 16.5);
--    element:SetParentElement(compositionFire_dust_cycle);
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0.29033535088953);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(2.04, 3.76);
--
--    effector:SetKey(_TRACK_X, 2.04, 558.362034588863);
--    effector:SetKey(_TRACK_Y, 2.04, 613.649163776004);
--    effector:SetKey(_TRACK_X, 2.24, 553.822302753228);
--    effector:SetKey(_TRACK_Y, 2.24, 554.487623413894);
--    effector:SetKey(_TRACK_X, 2.4, 572.183030802691);
--    effector:SetKey(_TRACK_Y, 2.4, 514.548783755742);
--    effector:SetKey(_TRACK_X, 2.56, 570.096528883625);
--    effector:SetKey(_TRACK_Y, 2.56, 467.628238551016);
--    effector:SetKey(_TRACK_X, 2.76, 595.453903122362);
--    effector:SetKey(_TRACK_Y, 2.76, 419.764356055297);
--    effector:SetKey(_TRACK_X, 2.92, 593.52769617671);
--    effector:SetKey(_TRACK_Y, 2.92, 374.671320965504);
--    effector:SetKey(_TRACK_X, 3.12, 619.642792064991);
--    effector:SetKey(_TRACK_Y, 3.12, 330.061490527201);
--    effector:SetKey(_TRACK_X, 3.36, 614.672038974205);
--    effector:SetKey(_TRACK_Y, 3.36, 262.320564426337);
--    effector:SetKey(_TRACK_X, 3.72, 649.829074409892);
--    effector:SetKey(_TRACK_Y, 3.72, 181.758227744258);
--    effector:SetKey(_TRACK_O, 2.04, 0);
--    effector:SetKey(_TRACK_O, 2.2, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 3.28, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 3.72, 0.01);
--
--    effector:Play();
--
--
--    -- Layer Layer_2
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/fire_dust.png');
--    element:SetName('Layer_2');
--    compositionFire_dust_cycle:AddElement(element);
--    element:SetHotSpot(16, 16.5);
--    element:SetParentElement(compositionFire_dust_cycle);
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(-0.15166459404236);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(1.4, 3.12);
--
--    effector:SetKey(_TRACK_X, 1.4, 510.220076887563);
--    effector:SetKey(_TRACK_Y, 1.4, 600.130712394576);
--    effector:SetKey(_TRACK_X, 1.6, 480.810387895959);
--    effector:SetKey(_TRACK_Y, 1.6, 548.596575974392);
--    effector:SetKey(_TRACK_X, 1.76, 480.322851812858);
--    effector:SetKey(_TRACK_Y, 1.76, 504.642172823927);
--    effector:SetKey(_TRACK_X, 1.92, 458.366694437517);
--    effector:SetKey(_TRACK_Y, 1.92, 463.123283076292);
--    effector:SetKey(_TRACK_X, 2.12, 460.813491095831);
--    effector:SetKey(_TRACK_Y, 2.12, 409.01264768952);
--    effector:SetKey(_TRACK_X, 2.28, 439.783937943396);
--    effector:SetKey(_TRACK_Y, 2.28, 369.0770748125);
--    effector:SetKey(_TRACK_X, 2.48, 444.307552158484);
--    effector:SetKey(_TRACK_Y, 2.48, 317.583656597924);
--    effector:SetKey(_TRACK_X, 2.72, 410.838448259837);
--    effector:SetKey(_TRACK_Y, 2.72, 258.478999086744);
--    effector:SetKey(_TRACK_X, 3.08, 408.156438522942);
--    effector:SetKey(_TRACK_Y, 3.08, 170.620510276191);
--    effector:SetKey(_TRACK_O, 1.4, 0);
--    effector:SetKey(_TRACK_O, 1.56, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 2.64, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 3.08, 0.01);
--
--    effector:Play();
--
--
--    -- Layer Layer_3
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/fire_dust.png');
--    element:SetName('Layer_3');
--    compositionFire_dust_cycle:AddElement(element);
--    element:SetHotSpot(16, 16.5);
--    element:SetParentElement(compositionFire_dust_cycle);
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0.09103542691758);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0.72, 2.44);
--
--    effector:SetKey(_TRACK_X, 0.72, 531.081967808005);
--    effector:SetKey(_TRACK_Y, 0.72, 618.606282098662);
--    effector:SetKey(_TRACK_X, 0.92, 514.919109265029);
--    effector:SetKey(_TRACK_Y, 0.92, 561.514609966233);
--    effector:SetKey(_TRACK_X, 1.08, 525.009176704166);
--    effector:SetKey(_TRACK_Y, 1.08, 518.731227832283);
--    effector:SetKey(_TRACK_X, 1.24, 513.674498343373);
--    effector:SetKey(_TRACK_Y, 1.24, 473.152547300434);
--    effector:SetKey(_TRACK_X, 1.44, 529.053691273618);
--    effector:SetKey(_TRACK_Y, 1.44, 421.215777082585);
--    effector:SetKey(_TRACK_X, 1.6, 518.237951144577);
--    effector:SetKey(_TRACK_Y, 1.6, 377.396696167214);
--    effector:SetKey(_TRACK_X, 1.8, 535.004114456778);
--    effector:SetKey(_TRACK_Y, 1.8, 328.49954928954);
--    effector:SetKey(_TRACK_X, 2.04, 516.720192632491);
--    effector:SetKey(_TRACK_Y, 2.04, 263.08365169564);
--    effector:SetKey(_TRACK_X, 2.4, 535.231323265875);
--    effector:SetKey(_TRACK_Y, 2.4, 177.155511514575);
--    effector:SetKey(_TRACK_O, 0.72, 0);
--    effector:SetKey(_TRACK_O, 0.88, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 1.96, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 2.4, 0.01);
--
--    effector:Play();
--
--
--    -- Layer Layer_4
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/fire_dust.png');
--    element:SetName('Layer_4');
--    compositionFire_dust_cycle:AddElement(element);
--    element:SetHotSpot(16, 16.5);
--    element:SetParentElement(compositionFire_dust_cycle);
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 1.72);
--
--    effector:SetKey(_TRACK_X, 0, 509);
--    effector:SetKey(_TRACK_Y, 0, 609);
--    effector:SetKey(_TRACK_X, 0.2, 487.713880738376);
--    effector:SetKey(_TRACK_Y, 0.2, 553.614097913485);
--    effector:SetKey(_TRACK_X, 0.36, 493.872740558612);
--    effector:SetKey(_TRACK_Y, 0.36, 510.090590547228);
--    effector:SetKey(_TRACK_X, 0.52, 478.441451684777);
--    effector:SetKey(_TRACK_Y, 0.52, 465.731077742653);
--    effector:SetKey(_TRACK_X, 0.72, 489.035403343992);
--    effector:SetKey(_TRACK_Y, 0.72, 412.611252214989);
--    effector:SetKey(_TRACK_X, 0.88, 474.280868588231);
--    effector:SetKey(_TRACK_Y, 0.88, 369.956876226728);
--    effector:SetKey(_TRACK_X, 1.08, 486.532378733384);
--    effector:SetKey(_TRACK_Y, 1.08, 319.737998260854);
--    effector:SetKey(_TRACK_X, 1.32, 462.3772260749);
--    effector:SetKey(_TRACK_Y, 1.32, 256.255165500038);
--    effector:SetKey(_TRACK_X, 1.68, 473);
--    effector:SetKey(_TRACK_Y, 1.68, 169);
--    effector:SetKey(_TRACK_O, 0, 0);
--    effector:SetKey(_TRACK_O, 0.16, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 1.24, 0.55984221869941);
--    effector:SetKey(_TRACK_O, 1.68, 0.01);
--
--    effector:Play();
--
--    compositionFire_dust_cycle:Play();
--
--    return compositionFire_dust_cycle;
--end

--createCompositionsvet_cycle = function()
--
--    local compositionsvet_cycle = CreateCompositionSequence();
--    local compositionDuration = 2;
--    compositionsvet_cycle:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/Svet_iz_okna2.png');
--    element:SetName('Layer_1');
--    compositionsvet_cycle:AddElement(element);
--    element:SetHotSpot(376, 303.5);
--    element:SetParentElement(compositionsvet_cycle);
--    element:SetXY(650.5, 371);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 2);
--
----    effector:SetKey(_TRACK_O, -1, 0);
--    effector:SetKey(_TRACK_O, 0, 1);
--    effector:SetKey(_TRACK_O, 1, 0);
--
--    effector:Play();
--
--
--    -- Layer Layer_2
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/Svet_iz_okna2.png');
--    element:SetName('Layer_2');
--    compositionsvet_cycle:AddElement(element);
--    element:SetHotSpot(376, 303.5);
--    element:SetParentElement(compositionsvet_cycle);
--    element:SetXY(650.5, 371);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 2);
--
--    effector:SetKey(_TRACK_O, 1, 0);
--    effector:SetKey(_TRACK_O, 2.04, 1);
--
--    effector:Play();
--
--
--    -- Layer Layer_3
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/Svet_iz_okna2.png');
--    element:SetName('Layer_3');
--    compositionsvet_cycle:AddElement(element);
--    element:SetHotSpot(376, 303.5);
--    element:SetParentElement(compositionsvet_cycle);
--    element:SetXY(650.5, 353);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 2);
--
--    effector:SetKey(_TRACK_O, 0, 0);
--    effector:SetKey(_TRACK_O, 1, 1);
--    effector:SetKey(_TRACK_O, 2.04, 0);
--
--    effector:Play();
--
--    compositionsvet_cycle:Play();
--
--    return compositionsvet_cycle;
--end

--createCompositiondust_cycle = function()
--
--    local compositiondust_cycle = CreateCompositionSequence();
--    local compositionDuration = 10.7916666666667;
--    compositiondust_cycle:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/dust.png');
--    element:SetName('Layer_1');
--    compositiondust_cycle:AddElement(element);
--    element:SetHotSpot(514, 514);
--    element:SetParentElement(compositiondust_cycle);
--    element:SetXY(514, 254);
--
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 1.66);
--
--    effector:SetKey(_TRACK_SX, -5.48, 1);
--    effector:SetKey(_TRACK_SY, -5.48, 1);
--    effector:SetKey(_TRACK_SX, 1.64, 1.38);
--    effector:SetKey(_TRACK_SY, 1.64, 1.38);
--    effector:SetKey(_TRACK_O, -5.48, 0);
--    effector:SetKey(_TRACK_O, -3.84, 1);
--    effector:SetKey(_TRACK_O, -0.04, 1);
--    effector:SetKey(_TRACK_O, 1.64, 0);
--
--    effector:Play();
--
--
--    -- Layer Layer_2
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/dust.png');
--    element:SetName('Layer_2');
--    compositiondust_cycle:AddElement(element);
--    element:SetHotSpot(514, 514);
--    element:SetParentElement(compositiondust_cycle);
--    element:SetXY(514, 254);
--
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(5.36, 10.8);
--
--    effector:SetKey(_TRACK_SX, 5.36, 1);
--    effector:SetKey(_TRACK_SY, 5.36, 1);
--    effector:SetKey(_TRACK_SX, 10.8, 1.29033707865169);
--    effector:SetKey(_TRACK_SY, 10.8, 1.29033707865169);
--    effector:SetKey(_TRACK_O, 5.36, 0);
--    effector:SetKey(_TRACK_O, 7, 1);
--    effector:SetKey(_TRACK_O, 10.8, 1);
--
--    effector:Play();
--
--
--    -- Layer Layer_3
--    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/dust.png');
--    element:SetName('Layer_3');
--    compositiondust_cycle:AddElement(element);
--    element:SetHotSpot(514, 514);
--    element:SetParentElement(compositiondust_cycle);
--    element:SetXY(514, 254);
--
--    element:SetAngle(0);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 7.14);
--
--    effector:SetKey(_TRACK_SX, 0, 1);
--    effector:SetKey(_TRACK_SY, 0, 1);
--    effector:SetKey(_TRACK_SX, 7.12, 1.38);
--    effector:SetKey(_TRACK_SY, 7.12, 1.38);
--    effector:SetKey(_TRACK_O, 0, 0);
--    effector:SetKey(_TRACK_O, 1.64, 1);
--    effector:SetKey(_TRACK_O, 5.44, 1);
--    effector:SetKey(_TRACK_O, 7.12, 0);
--
--    effector:Play();
--
--    compositiondust_cycle:Play();
--
--    return compositiondust_cycle;
--end

createCompositiondyno_1 = function()

    local compositiondyno_1 = CreateCompositionSequence();
    local compositionDuration = 10;
    compositiondyno_1:SetDuration(compositionDuration);


    -- Layer Layer_1
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/head_1.png');
    element:SetName('Layer_1');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(85.5, 41);
    compositiondyno_1:RegisterParentInfo('Layer_1', 'Layer_2');
    element:SetXY(5, 5.5);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 2.56, -0.07585235311935);
    effector:SetKey(_TRACK_A, 4.4, -0.22253636815708);
    effector:SetKey(_TRACK_A, 5.64, 0.26354683489673);
    effector:SetKey(_TRACK_A, 7.04, 0);
    effector:SetKey(_TRACK_A, 8.52, 0.0811859379432);
    effector:SetKey(_TRACK_A, 9.96, 0);

    effector:Play();


    -- Layer Layer_2
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/head_2.png');
    element:SetName('Layer_2');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(36, 24.5);
    compositiondyno_1:RegisterParentInfo('Layer_2', 'Layer_3');
    element:SetXY(9, 7.49999999999977);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.31772015033503);
    effector:SetKey(_TRACK_A, 2.56, 0.29784004932454);
    effector:SetKey(_TRACK_A, 4.4, -0.06647190221909);
    effector:SetKey(_TRACK_A, 5.64, 0.25853335948894);
    effector:SetKey(_TRACK_A, 7.04, -0.31772015033503);
    effector:SetKey(_TRACK_A, 8.52, -0.14391468734382);
    effector:SetKey(_TRACK_A, 9.96, -0.31772015033503);

    effector:Play();


    -- Layer Layer_3
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/head_3.png');
    element:SetName('Layer_3');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(34, 22.5);
    compositiondyno_1:RegisterParentInfo('Layer_3', 'Layer_5');
    element:SetXY(11.5, 10.0000000000001);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.14129884846103);
    effector:SetKey(_TRACK_A, 2.56, 0.18065862306261);
    effector:SetKey(_TRACK_A, 4.4, 0.11064588476007);
    effector:SetKey(_TRACK_A, 7.04, -0.14129884846103);
    effector:SetKey(_TRACK_A, 8.52, -0.05776184255558);
    effector:SetKey(_TRACK_A, 9.96, -0.14129884846103);

    effector:Play();


    -- Layer Layer_4
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/tail_4.png');
    element:SetName('Layer_4');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(9.5, 17.5);
    compositiondyno_1:RegisterParentInfo('Layer_4', 'Layer_9');
    element:SetXY(44, 19);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.18182450464265);
    effector:SetKey(_TRACK_A, 2.56, 0.32075521304204);
    effector:SetKey(_TRACK_A, 7.04, -0.18182450464265);
    effector:SetKey(_TRACK_A, 9.96, -0.18182450464265);

    effector:Play();


    -- Layer Layer_5
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/head_4.png');
    element:SetName('Layer_5');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(44.5, 25);
    compositiondyno_1:RegisterParentInfo('Layer_5', 'Layer_7');
    element:SetXY(11.5, 19.5000000000001);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.38605507403566);
    effector:SetKey(_TRACK_A, 2.56, 0.14042728645129);
    effector:SetKey(_TRACK_A, 4.4, 0.14042728645129);
    effector:SetKey(_TRACK_A, 7.04, -0.38605507403566);
    effector:SetKey(_TRACK_A, 8.52, -0.31522507726011);
    effector:SetKey(_TRACK_A, 9.96, -0.38605507403566);

    effector:Play();


    -- Layer Layer_6
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/tail_2.png');
    element:SetName('Layer_6');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(9.5, 22);
    compositiondyno_1:RegisterParentInfo('Layer_6', 'Layer_8');
    element:SetXY(86, 42);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.24748788337801);
    effector:SetKey(_TRACK_A, 2.56, 0.21193162901847);
    effector:SetKey(_TRACK_A, 7.04, -0.24748788337801);
    effector:SetKey(_TRACK_A, 9.96, -0.24748788337801);

    effector:Play();


    -- Layer Layer_7
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/head_5.png');
    element:SetName('Layer_7');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(51.5, 28.5);
    compositiondyno_1:RegisterParentInfo('Layer_7', 'Layer_10');
    element:SetXY(17, 56.4999999999999);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.21148476446689);
    effector:SetKey(_TRACK_A, 2.56, 0.18579551169057);
    effector:SetKey(_TRACK_A, 4.4, 0.18579551169057);
    effector:SetKey(_TRACK_A, 7.04, -0.21148476446689);
    effector:SetKey(_TRACK_A, 8.52, -0.12270749513633);
    effector:SetKey(_TRACK_A, 9.96, -0.21148476446689);

    effector:Play();


    -- Layer Layer_8
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/tail_1.png');
    element:SetName('Layer_8');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(17, 26);
    compositiondyno_1:RegisterParentInfo('Layer_8', 'Layer_10');
    element:SetXY(200, 54.5);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, 0.24766066066906);
    effector:SetKey(_TRACK_A, 2.56, -0.13691854708148);
    effector:SetKey(_TRACK_A, 7.04, 0.24766066066906);
    effector:SetKey(_TRACK_A, 9.96, 0.24766066066906);

    effector:Play();


    -- Layer Layer_9
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/tail_3.png');
    element:SetName('Layer_9');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(10, 17);
    compositiondyno_1:RegisterParentInfo('Layer_9', 'Layer_6');
    element:SetXY(46.5, 28);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, -0.10188598052715);
    effector:SetKey(_TRACK_A, 2.56, 0.34118206561106);
    effector:SetKey(_TRACK_A, 7.04, -0.10188598052715);
    effector:SetKey(_TRACK_A, 9.96, -0.10188598052715);

    effector:Play();


    -- Layer Layer_10
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/torso.png');
    element:SetName('Layer_10');
    compositiondyno_1:AddElement(element);
    element:SetHotSpot(106, 88.5);
    element:SetParentElement(compositiondyno_1);
    element:SetXY(650, 352);

    element:SetScaleX(0.3992111715169);
    element:SetScaleY(0.3992111715169);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 4.4, 0);
    effector:SetKey(_TRACK_A, 7.04, 0);
    effector:SetKey(_TRACK_A, 9.96, 0);

    effector:Play();

    compositiondyno_1:Play();

    return compositiondyno_1;
end

createCompositionpalmTwig = function()

    local compositionpalmTwig = CreateCompositionSequence();
    local compositionDuration = 6.25;
    compositionpalmTwig:SetDuration(compositionDuration);


    -- Layer Layer_1
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/v1.png');
    element:SetName('Layer_1');
    compositionpalmTwig:AddElement(element);
    element:SetHotSpot(28, 2.5);
    compositionpalmTwig:RegisterParentInfo('Layer_1', 'Layer_2');
    element:SetXY(39.25, 32.75);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 6.28);

    effector:SetKey(_TRACK_A, -0.01919998168945, -0.02216067592137);
    effector:SetKey(_TRACK_A, 1.04160784244537, 0.0353048031712);
    effector:SetKey(_TRACK_A, 2.60160766601562, -0.04920325431788);
    effector:SetKey(_TRACK_A, 3.10079990386963, -0.02216067592137);
    effector:SetKey(_TRACK_A, 4.16160760879517, 0.0353048031712);
    effector:SetKey(_TRACK_A, 5.72160755157471, -0.04920325431788);
    effector:SetKey(_TRACK_A, 6.22079978942871, -0.02216067592137);

    effector:Play();


    -- Layer Layer_2
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/v2.png');
    element:SetName('Layer_2');
    compositionpalmTwig:AddElement(element);
    element:SetHotSpot(26, 12.5);
    compositionpalmTwig:RegisterParentInfo('Layer_2', 'Layer_3');
    element:SetXY(58.75, 40);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 6.28);

    effector:SetKey(_TRACK_A, -0.01120002746582, 0.00143566087224);
    effector:SetKey(_TRACK_A, 0.79999212741852, 0.04641280104244);
    effector:SetKey(_TRACK_A, 2.35999218940735, -0.04008169928486);
    effector:SetKey(_TRACK_A, 3.10879985809326, 0.00143566087224);
    effector:SetKey(_TRACK_A, 3.91999213218689, 0.04641280104244);
    effector:SetKey(_TRACK_A, 5.47999183654785, -0.04008169928486);
    effector:SetKey(_TRACK_A, 6.22879974365234, 0.00143566087224);

    effector:Play();


    -- Layer Layer_3
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/v3.png');
    element:SetName('Layer_3');
    compositionpalmTwig:AddElement(element);
    element:SetHotSpot(42, 17.5);
    compositionpalmTwig:RegisterParentInfo('Layer_3', 'Layer_4');
    element:SetXY(79.25, 66.75);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 6.28);

    effector:SetKey(_TRACK_A, -0.01920003890991, 0.02033011047992);
    effector:SetKey(_TRACK_A, 0.47999213933945, 0.04662703821153);
    effector:SetKey(_TRACK_A, 2.03999214172363, -0.03555086094976);
    effector:SetKey(_TRACK_A, 3.10079984664917, 0.02033011047992);
    effector:SetKey(_TRACK_A, 3.59999208450317, 0.04662703821153);
    effector:SetKey(_TRACK_A, 5.15999202728271, -0.03555086094976);
    effector:SetKey(_TRACK_A, 6.22079973220825, 0.02033011047992);

    effector:Play();


    -- Layer Layer_4
    local element = CreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Top/v4.png');
    element:SetName('Layer_4');
    compositionpalmTwig:AddElement(element);
    element:SetHotSpot(62, 40);
    element:SetParentElement(compositionpalmTwig);
    element:SetXY(856.5, 140.5);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 6.28);

    effector:SetKey(_TRACK_A, -5.7220458984375e-8, 0.015176089158);
    effector:SetKey(_TRACK_A, 1.55999988555908, -0.01523891505639);
    effector:SetKey(_TRACK_A, 3.11999982833862, 0.015176089158);
    effector:SetKey(_TRACK_A, 4.67999977111816, -0.01523891505639);
    effector:SetKey(_TRACK_A, 6.23999971389771, 0.015176089158);

    effector:Play();

    compositionpalmTwig:Play();

    return compositionpalmTwig;
end

------------------------------------------------------------------------------
--// Env2
--createCompositionbackground02 = function()
--
--    local compositionbackground02 = CreateCompositionSequence();
--    local compositionDuration = 9.96666666666667;
--    compositionbackground02:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = createCompositionEnvTop2();
--    element:SetName('Layer_1');
--    compositionbackground02:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionbackground02);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_2
--    local element = createCompositionL2Fly();
--    element:SetName('Layer_2');
--    compositionbackground02:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionbackground02);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_3
--    local element = createCompositionHummingBird1();
--    element:SetName('Layer_3');
--    compositionbackground02:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionbackground02);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--
--    -- Layer Layer_4
--    local element = createCompositionHummingBird2();
--    element:SetName('Layer_4');
--    compositionbackground02:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionbackground02);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--
--    -- Layer Bg
--    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/background02.jpg');
--    element:SetName('Bg');
--    compositionbackground02:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionbackground02);
--    element:SetXY(512, 384);
--
--    element:SetScaleX(1);
--    element:SetScaleY(1);
--    element:SetAngle(0);
--    element:SetOpacity(1);
--
--    effector = element:GetEffector();
--    effector:SetLifeTime(0, 10);
--
--
--    effector:Play();
--
--    compositionbackground02:Play();
--
--    return compositionbackground02;
--end

createCompositionEnvTop2 = function()

    local compositionEnvTop2 = CreateCompositionSequence();
    local compositionDuration = 9.96666666666667;
    compositionEnvTop2:SetDuration(compositionDuration);


    -- Layer dust2
    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/EF_Dust_01.jpg');
    element:SetName('dust2');
    compositionEnvTop2:AddElement(element);
    element:SetHotSpot(130.5, 131);
    element:SetParentElement(compositionEnvTop2);
    element:SetScaleX(1.5);
    element:SetScaleY(1.5);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_X, 0, 757.621612548828);
    effector:SetKey(_TRACK_Y, 0, 323.027038574219);
    effector:SetKey(_TRACK_X, 9.96666666666667, 780.972961425781);
    effector:SetKey(_TRACK_Y, 9.96666666666667, 192.000015258789);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 9.96666666666667, 0.7853981625);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.8, 0);
    effector:SetKey(_TRACK_O, 1.76666666666667, 1);
    effector:SetKey(_TRACK_O, 2.2, 0);
    effector:SetKey(_TRACK_O, 2.8, 0.8);
    effector:SetKey(_TRACK_O, 3.46666666666667, 0);
    effector:SetKey(_TRACK_O, 4.1, 1);
    effector:SetKey(_TRACK_O, 4.56666666666667, 0);
    effector:SetKey(_TRACK_O, 5.33333333333333, 0);
    effector:SetKey(_TRACK_O, 6.3, 1);
    effector:SetKey(_TRACK_O, 7.1, 0);
    effector:SetKey(_TRACK_O, 7.9, 0.8);
    effector:SetKey(_TRACK_O, 9, 0.8);
    effector:SetKey(_TRACK_O, 9.96666666666667, 0);

    effector:Play();


    -- Layer dust
    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/EF_Dust_01.jpg');
    element:SetName('dust');
    compositionEnvTop2:AddElement(element);
    element:SetHotSpot(130.5, 131);
    element:SetParentElement(compositionEnvTop2);
    element:SetScaleX(1.5);
    element:SetScaleY(1.5);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_X, 0, 543.567565917969);
    effector:SetKey(_TRACK_Y, 0, 609.729736328125);
    effector:SetKey(_TRACK_X, 9.96666666666667, 566.918914794922);
    effector:SetKey(_TRACK_Y, 9.96666666666667, 478.702713012695);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 9.96666666666667, 0.7853981625);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.8, 0.8);
    effector:SetKey(_TRACK_O, 1.73333333333333, 0);
    effector:SetKey(_TRACK_O, 2.7, 1);
    effector:SetKey(_TRACK_O, 3.13333333333333, 0);
    effector:SetKey(_TRACK_O, 3.73333333333333, 0.8);
    effector:SetKey(_TRACK_O, 4.4, 0);
    effector:SetKey(_TRACK_O, 5.03333333333333, 1);
    effector:SetKey(_TRACK_O, 5.5, 0);
    effector:SetKey(_TRACK_O, 6.26666666666667, 0);
    effector:SetKey(_TRACK_O, 7.23333333333333, 1);
    effector:SetKey(_TRACK_O, 8.03333333333333, 0);
    effector:SetKey(_TRACK_O, 8.83333333333333, 0.8);
    effector:SetKey(_TRACK_O, 9.96666666666667, 0);

    effector:Play();


    -- Layer light
    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/EF_Light01.jpg');
    element:SetName('light');
    compositionEnvTop2:AddElement(element);
    element:SetHotSpot(86, 76);
    element:SetParentElement(compositionEnvTop2);
    element:SetXY(364.162170410156, 171.243240356445);

    element:SetScaleX(8.99728630293954);
    element:SetScaleY(6.96170032244864);
    element:SetAngle(0.29275980562744);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 1.36666666666667, 0.24079120879121);
    effector:SetKey(_TRACK_O, 2.1, 0.09661537656679);
    effector:SetKey(_TRACK_O, 3.53333333333333, 0.4);
    effector:SetKey(_TRACK_O, 4.06666666666667, 0.09661537656679);
    effector:SetKey(_TRACK_O, 5.36666666666667, 0.32861537656679);
    effector:SetKey(_TRACK_O, 6.53333333333333, 0.12237363442222);
    effector:SetKey(_TRACK_O, 7.3, 0.24079120879121);
    effector:SetKey(_TRACK_O, 8.16666666666667, 0.03314286519145);
    effector:SetKey(_TRACK_O, 9.06666666666667, 0.12237363442222);
    effector:SetKey(_TRACK_O, 9.96666666666667, 0);

    effector:Play();

    compositionEnvTop2:Play();

    return compositionEnvTop2;
end

createCompositionHummingBird1 = function()

    local compositionHummingBird1 = CreateCompositionSequence();
    local compositionDuration = 9.96666666666667;
    compositionHummingBird1:SetDuration(compositionDuration);


    -- Layer bird2
    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/Colibri_[01-02].png');
    element:SetName('bird2');
    compositionHummingBird1:AddElement(element);
    element:SetHotSpot(53.5, 32);
    element:SetParentElement(compositionHummingBird1);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_X, 0, 1081.94595336914);
    effector:SetKey(_TRACK_Y, 0, 517.621597290039);
    effector:SetKey(_TRACK_X, 0.2, 962.594604492188);
    effector:SetKey(_TRACK_Y, 0.2, 446.270248413086);
    effector:SetKey(_TRACK_X, 1.4, 962.594604492188);
    effector:SetKey(_TRACK_Y, 1.4, 446.270248413086);
    effector:SetKey(_TRACK_X, 1.63333333333333, 720.527038574219);
    effector:SetKey(_TRACK_Y, 1.63333333333333, 348.864837646484);
    effector:SetKey(_TRACK_X, 3.7, 720.527038574219);
    effector:SetKey(_TRACK_Y, 3.7, 348.864837646484);
    effector:SetKey(_TRACK_X, 3.96666666666667, 527.152188621775);
    effector:SetKey(_TRACK_Y, 3.96666666666667, 427.162879740269);
    effector:SetKey(_TRACK_X, 4.13333333333333, 344.527038574219);
    effector:SetKey(_TRACK_Y, 4.13333333333333, 438.864837646484);
    effector:SetKey(_TRACK_X, 5.13333333333333, 344.527038574219);
    effector:SetKey(_TRACK_Y, 5.13333333333333, 438.864837646484);
    effector:SetKey(_TRACK_X, 5.33333333333333, 226.527038574219);
    effector:SetKey(_TRACK_Y, 5.33333333333333, 357.864837646484);
    effector:SetKey(_TRACK_X, 5.46666666666667, 193.527038574219);
    effector:SetKey(_TRACK_Y, 5.46666666666667, 240.864837646484);
    effector:SetKey(_TRACK_X, 5.6, 220.527038574219);
    effector:SetKey(_TRACK_Y, 5.6, 112.864837646484);
    effector:SetKey(_TRACK_X, 6.76666666666667, 220.527038574219);
    effector:SetKey(_TRACK_Y, 6.76666666666667, 112.864837646484);
    effector:SetKey(_TRACK_X, 7.06666666666667, 220.527038574219);
    effector:SetKey(_TRACK_Y, 7.06666666666667, 112.864837646484);
    effector:SetKey(_TRACK_X, 7.4, 620.094604492188);
    effector:SetKey(_TRACK_Y, 7.4, 53.1891632080078);
    effector:SetKey(_TRACK_X, 8.03333333333333, 620.094604492188);
    effector:SetKey(_TRACK_Y, 8.03333333333333, 53.1891632080078);
    effector:SetKey(_TRACK_X, 8.16666666666667, 662.594604492188);
    effector:SetKey(_TRACK_Y, 8.16666666666667, 75.6891632080078);
    effector:SetKey(_TRACK_X, 8.3, 717.594604492188);
    effector:SetKey(_TRACK_Y, 8.3, 87.1891632080078);
    effector:SetKey(_TRACK_X, 8.43333333333333, 775.094604492188);
    effector:SetKey(_TRACK_Y, 8.43333333333333, 73.1891632080078);
    effector:SetKey(_TRACK_X, 8.56666666666667, 807.094604492188);
    effector:SetKey(_TRACK_Y, 8.56666666666667, 56.1891632080078);
    effector:SetKey(_TRACK_X, 9.23333333333333, 807.094604492188);
    effector:SetKey(_TRACK_Y, 9.23333333333333, 56.1891632080078);
    effector:SetKey(_TRACK_X, 9.33333333333333, 862.878387451172);
    effector:SetKey(_TRACK_Y, 9.33333333333333, 108.0810546875);
    effector:SetKey(_TRACK_X, 9.53333333333333, 930.337844848633);
    effector:SetKey(_TRACK_Y, 9.53333333333333, 240.405380249023);
    effector:SetKey(_TRACK_X, 9.63333333333333, 965.364868164063);
    effector:SetKey(_TRACK_Y, 9.63333333333333, 259.864837646484);
    effector:SetKey(_TRACK_X, 9.76666666666667, 993.905410766602);
    effector:SetKey(_TRACK_Y, 9.76666666666667, 210.567535400391);
    effector:SetKey(_TRACK_X, 9.93333333333333, 1036.71621704102);
    effector:SetKey(_TRACK_Y, 9.93333333333333, 71.7567291259766);
    effector:SetKey(_TRACK_X, 9.96666666666667, 1080.82432556152);
    effector:SetKey(_TRACK_Y, 9.96666666666667, 23.7567291259766);
    effector:SetKey(_TRACK_SX, 0, 1);
    effector:SetKey(_TRACK_SY, 0, 1);
    effector:SetKey(_TRACK_SX, 0.2, 0.8);
    effector:SetKey(_TRACK_SY, 0.2, 0.8);
    effector:SetKey(_TRACK_SX, 0.33333333333333, 0.9);
    effector:SetKey(_TRACK_SY, 0.33333333333333, 0.9);
    effector:SetKey(_TRACK_SX, 0.86666666666667, 0.85);
    effector:SetKey(_TRACK_SY, 0.86666666666667, 0.85);
    effector:SetKey(_TRACK_SX, 1.4, 0.9);
    effector:SetKey(_TRACK_SY, 1.4, 0.9);
    effector:SetKey(_TRACK_SX, 1.63333333333333, 0.6);
    effector:SetKey(_TRACK_SY, 1.63333333333333, 0.6);
    effector:SetKey(_TRACK_SX, 1.73333333333333, 0.55);
    effector:SetKey(_TRACK_SY, 1.73333333333333, 0.55);
    effector:SetKey(_TRACK_SX, 1.93333333333333, 0.6);
    effector:SetKey(_TRACK_SY, 1.93333333333333, 0.6);
    effector:SetKey(_TRACK_SX, 2.86666666666667, 0.65);
    effector:SetKey(_TRACK_SY, 2.86666666666667, 0.65);
    effector:SetKey(_TRACK_SX, 3.66666666666667, 0.6);
    effector:SetKey(_TRACK_SY, 3.66666666666667, 0.6);
    effector:SetKey(_TRACK_SX, 4.13333333333333, 0.7);
    effector:SetKey(_TRACK_SY, 4.13333333333333, 0.7);
    effector:SetKey(_TRACK_SX, 4.3, 0.65);
    effector:SetKey(_TRACK_SY, 4.3, 0.65);
    effector:SetKey(_TRACK_SX, 4.66666666666667, 0.6);
    effector:SetKey(_TRACK_SY, 4.66666666666667, 0.6);
    effector:SetKey(_TRACK_SX, 5.13333333333333, 0.65);
    effector:SetKey(_TRACK_SY, 5.13333333333333, 0.65);
    effector:SetKey(_TRACK_SX, 5.6, 0.5);
    effector:SetKey(_TRACK_SY, 5.6, 0.5);
    effector:SetKey(_TRACK_SX, 5.63333333333333, -0.5);
    effector:SetKey(_TRACK_SY, 5.63333333333333, 0.5);
    effector:SetKey(_TRACK_SX, 7.06666666666667, -0.5);
    effector:SetKey(_TRACK_SY, 7.06666666666667, 0.5);
    effector:SetKey(_TRACK_SX, 7.4, -0.4);
    effector:SetKey(_TRACK_SY, 7.4, 0.4);
    effector:SetKey(_TRACK_SX, 8, -0.5);
    effector:SetKey(_TRACK_SY, 8, 0.5);
    effector:SetKey(_TRACK_SX, 8.56666666666667, -0.4);
    effector:SetKey(_TRACK_SY, 8.56666666666667, 0.4);
    effector:SetKey(_TRACK_SX, 9.2, -0.3);
    effector:SetKey(_TRACK_SY, 9.2, 0.3);
    effector:SetKey(_TRACK_SX, 9.96666666666667, -0.6);
    effector:SetKey(_TRACK_SY, 9.96666666666667, 0.6);
    effector:SetKey(_TRACK_A, 0, -0.45903899085887);
    effector:SetKey(_TRACK_A, 0.46666666666667, 0.03128719556923);
    effector:SetKey(_TRACK_A, 0.86666666666667, -0.20042949361486);
    effector:SetKey(_TRACK_A, 1.33333333333333, -0.07366212170791);
    effector:SetKey(_TRACK_A, 1.43333333333333, -0.58982272294477);
    effector:SetKey(_TRACK_A, 1.73333333333333, -0.121255933173);
    effector:SetKey(_TRACK_A, 2.2, -0.26368693721704);
    effector:SetKey(_TRACK_A, 2.5, -0.14744042353985);
    effector:SetKey(_TRACK_A, 2.83333333333333, -0.27349996023803);
    effector:SetKey(_TRACK_A, 3.2, -0.35195138168223);
    effector:SetKey(_TRACK_A, 3.46666666666667, -0.13144337598029);
    effector:SetKey(_TRACK_A, 3.93333333333333, -0.58625085843203);
    effector:SetKey(_TRACK_A, 4.23333333333333, -0.21939056913088);
    effector:SetKey(_TRACK_A, 4.93333333333333, -0.0183631016625);
    effector:SetKey(_TRACK_A, 5.36666666666667, -0.18077464191286);
    effector:SetKey(_TRACK_A, 5.73333333333333, 0.03257228466823);
    effector:SetKey(_TRACK_A, 6.16666666666667, 0.45018115187763);
    effector:SetKey(_TRACK_A, 6.46666666666667, 0.19718353297732);
    effector:SetKey(_TRACK_A, 6.86666666666667, 0.32491584646384);
    effector:SetKey(_TRACK_A, 7.2, 0.75109105156948);
    effector:SetKey(_TRACK_A, 7.56666666666667, 0.08757252576426);
    effector:SetKey(_TRACK_A, 8.03333333333333, 0.2926764171043);
    effector:SetKey(_TRACK_A, 8.36666666666667, 0.87241488550962);
    effector:SetKey(_TRACK_A, 8.7, 0.14860991288559);
    effector:SetKey(_TRACK_A, 9.96666666666667, 0.14860991288559);

    effector:Play();

    compositionHummingBird1:Play();

    return compositionHummingBird1;
end

createCompositionHummingBird2 = function()

    local compositionHummingBird2 = CreateCompositionSequence();
    local compositionDuration = 9.96666666666667;
    compositionHummingBird2:SetDuration(compositionDuration);


    -- Layer bird1
    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/Colibri_[01-02].png');
    element:SetName('bird1');
    compositionHummingBird2:AddElement(element);
    element:SetHotSpot(53.5, 32);
    element:SetParentElement(compositionHummingBird2);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_X, 0, -89.5135040283203);
    effector:SetKey(_TRACK_Y, 0, 271.135131835938);
    effector:SetKey(_TRACK_X, 0.16666666666667, 9.08108520507813);
    effector:SetKey(_TRACK_Y, 0.16666666666667, 282.810806274414);
    effector:SetKey(_TRACK_X, 0.36666666666667, 114.162170410156);
    effector:SetKey(_TRACK_Y, 0.36666666666667, 320.432434082031);
    effector:SetKey(_TRACK_X, 0.56666666666667, 206.270278930664);
    effector:SetKey(_TRACK_Y, 0.56666666666667, 310.054046630859);
    effector:SetKey(_TRACK_X, 0.73333333333333, 254.270278930664);
    effector:SetKey(_TRACK_Y, 0.73333333333333, 250.378372192383);
    effector:SetKey(_TRACK_X, 1.4, 254.270278930664);
    effector:SetKey(_TRACK_Y, 1.4, 250.378372192383);
    effector:SetKey(_TRACK_X, 1.56666666666667, 312.648651123047);
    effector:SetKey(_TRACK_Y, 1.56666666666667, 312.648635864258);
    effector:SetKey(_TRACK_X, 1.66666666666667, 406.054061889648);
    effector:SetKey(_TRACK_Y, 1.66666666666667, 369.729721069336);
    effector:SetKey(_TRACK_X, 1.8, 499.45947265625);
    effector:SetKey(_TRACK_Y, 1.8, 394.378372192383);
    effector:SetKey(_TRACK_X, 2.23333333333333, 499.45947265625);
    effector:SetKey(_TRACK_Y, 2.23333333333333, 394.378372192383);
    effector:SetKey(_TRACK_X, 2.43333333333333, 336.000015258789);
    effector:SetKey(_TRACK_Y, 2.43333333333333, 433.297286987305);
    effector:SetKey(_TRACK_X, 2.6, 323.027038574219);
    effector:SetKey(_TRACK_Y, 2.6, 442.378372192383);
    effector:SetKey(_TRACK_X, 2.76666666666667, 334.702713012695);
    effector:SetKey(_TRACK_Y, 2.76666666666667, 433.297286987305);
    effector:SetKey(_TRACK_X, 2.93333333333333, 323.027038574219);
    effector:SetKey(_TRACK_Y, 2.93333333333333, 441.081069946289);
    effector:SetKey(_TRACK_X, 3.1, 334.702713012695);
    effector:SetKey(_TRACK_Y, 3.1, 433.297286987305);
    effector:SetKey(_TRACK_X, 3.7, 334.702713012695);
    effector:SetKey(_TRACK_Y, 3.7, 433.297286987305);
    effector:SetKey(_TRACK_X, 3.83333333333333, 378.810821533203);
    effector:SetKey(_TRACK_Y, 3.83333333333333, 395.675659179688);
    effector:SetKey(_TRACK_X, 3.93333333333333, 487.783798217773);
    effector:SetKey(_TRACK_Y, 3.93333333333333, 335.999984741211);
    effector:SetKey(_TRACK_X, 4.03333333333333, 616.216232299805);
    effector:SetKey(_TRACK_Y, 4.03333333333333, 342.486465454102);
    effector:SetKey(_TRACK_X, 4.1, 697.945953369141);
    effector:SetKey(_TRACK_Y, 4.1, 378.810791015625);
    effector:SetKey(_TRACK_X, 4.23333333333333, 755.027038574219);
    effector:SetKey(_TRACK_Y, 4.23333333333333, 461.837829589844);
    effector:SetKey(_TRACK_X, 4.36666666666667, 694.054061889648);
    effector:SetKey(_TRACK_Y, 4.36666666666667, 502.054046630859);
    effector:SetKey(_TRACK_X, 4.46666666666667, 598.054061889648);
    effector:SetKey(_TRACK_Y, 4.46666666666667, 481.297286987305);
    effector:SetKey(_TRACK_X, 4.63333333333333, 492.97297668457);
    effector:SetKey(_TRACK_Y, 4.63333333333333, 398.270263671875);
    effector:SetKey(_TRACK_X, 4.73333333333333, 445.567565917969);
    effector:SetKey(_TRACK_Y, 4.73333333333333, 289.648635864258);
    effector:SetKey(_TRACK_X, 4.86666666666667, 428.567565917969);
    effector:SetKey(_TRACK_Y, 4.86666666666667, 208.648635864258);
    effector:SetKey(_TRACK_X, 5.5, 428.567565917969);
    effector:SetKey(_TRACK_Y, 5.5, 208.648635864258);
    effector:SetKey(_TRACK_X, 5.6, 456.567565917969);
    effector:SetKey(_TRACK_Y, 5.6, 188.648635864258);
    effector:SetKey(_TRACK_X, 5.7, 501.567565917969);
    effector:SetKey(_TRACK_Y, 5.7, 165.648635864258);
    effector:SetKey(_TRACK_X, 5.8, 452.567565917969);
    effector:SetKey(_TRACK_Y, 5.8, 173.648635864258);
    effector:SetKey(_TRACK_X, 5.9, 388.567565917969);
    effector:SetKey(_TRACK_Y, 5.9, 178.648635864258);
    effector:SetKey(_TRACK_X, 5.96666666666667, 337.567565917969);
    effector:SetKey(_TRACK_Y, 5.96666666666667, 169.648635864258);
    effector:SetKey(_TRACK_X, 6.03333333333333, 277.567565917969);
    effector:SetKey(_TRACK_Y, 6.03333333333333, 143.648635864258);
    effector:SetKey(_TRACK_X, 6.43333333333333, 277.567565917969);
    effector:SetKey(_TRACK_Y, 6.43333333333333, 143.648635864258);
    effector:SetKey(_TRACK_X, 6.5, 295.567565917969);
    effector:SetKey(_TRACK_Y, 6.5, 114.648635864258);
    effector:SetKey(_TRACK_X, 6.56666666666667, 302.567565917969);
    effector:SetKey(_TRACK_Y, 6.56666666666667, 84.6486358642578);
    effector:SetKey(_TRACK_X, 6.9, 302.567565917969);
    effector:SetKey(_TRACK_Y, 6.9, 84.6486358642578);
    effector:SetKey(_TRACK_X, 6.96666666666667, 258.567565917969);
    effector:SetKey(_TRACK_Y, 6.96666666666667, 94.6486358642578);
    effector:SetKey(_TRACK_X, 7.03333333333333, 209.567565917969);
    effector:SetKey(_TRACK_Y, 7.03333333333333, 83.6486358642578);
    effector:SetKey(_TRACK_X, 7.1, 168.567565917969);
    effector:SetKey(_TRACK_Y, 7.1, 42.6486358642578);
    effector:SetKey(_TRACK_X, 7.43333333333333, 168.567565917969);
    effector:SetKey(_TRACK_Y, 7.43333333333333, 42.6486358642578);
    effector:SetKey(_TRACK_X, 7.5, 228.567565917969);
    effector:SetKey(_TRACK_Y, 7.5, 69.6486358642578);
    effector:SetKey(_TRACK_X, 7.6, 317.567565917969);
    effector:SetKey(_TRACK_Y, 7.6, 96.6486358642578);
    effector:SetKey(_TRACK_X, 7.7, 408.567565917969);
    effector:SetKey(_TRACK_Y, 7.7, 93.6486358642578);
    effector:SetKey(_TRACK_X, 7.76666666666667, 457.567565917969);
    effector:SetKey(_TRACK_Y, 7.76666666666667, 57.6486358642578);
    effector:SetKey(_TRACK_X, 7.86666666666667, 517.567565917969);
    effector:SetKey(_TRACK_Y, 7.86666666666667, -73.3513641357422);
    effector:SetKey(_TRACK_X, 8.23333333333333, 517.567565917969);
    effector:SetKey(_TRACK_Y, 8.23333333333333, -73.3513641357422);
    effector:SetKey(_TRACK_X, 8.3, 543.567565917969);
    effector:SetKey(_TRACK_Y, 8.3, 21.6486358642578);
    effector:SetKey(_TRACK_X, 8.43333333333333, 579.567565917969);
    effector:SetKey(_TRACK_Y, 8.43333333333333, 78.6486358642578);
    effector:SetKey(_TRACK_X, 8.53333333333333, 642.567565917969);
    effector:SetKey(_TRACK_Y, 8.53333333333333, 94.6486358642578);
    effector:SetKey(_TRACK_X, 8.63333333333333, 689.567565917969);
    effector:SetKey(_TRACK_Y, 8.63333333333333, 73.6486358642578);
    effector:SetKey(_TRACK_X, 9.2, 689.567565917969);
    effector:SetKey(_TRACK_Y, 9.2, 73.6486358642578);
    effector:SetKey(_TRACK_X, 9.3, 630.567565917969);
    effector:SetKey(_TRACK_Y, 9.3, 108.648635864258);
    effector:SetKey(_TRACK_X, 9.4, 536.567565917969);
    effector:SetKey(_TRACK_Y, 9.4, 110.648635864258);
    effector:SetKey(_TRACK_X, 9.5, 458.567565917969);
    effector:SetKey(_TRACK_Y, 9.5, 88.6486358642578);
    effector:SetKey(_TRACK_X, 9.6, 401.567565917969);
    effector:SetKey(_TRACK_Y, 9.6, 47.6486358642578);
    effector:SetKey(_TRACK_X, 9.73333333333333, 337.567565917969);
    effector:SetKey(_TRACK_Y, 9.73333333333333, -41.3513641357422);
    effector:SetKey(_TRACK_SX, 0, -1);
    effector:SetKey(_TRACK_SY, 0, 1);
    effector:SetKey(_TRACK_SX, 0.73333333333333, -0.7);
    effector:SetKey(_TRACK_SY, 0.73333333333333, 0.7);
    effector:SetKey(_TRACK_SX, 1.03333333333333, -0.6);
    effector:SetKey(_TRACK_SY, 1.03333333333333, 0.6);
    effector:SetKey(_TRACK_SX, 1.4, -0.7);
    effector:SetKey(_TRACK_SY, 1.4, 0.7);
    effector:SetKey(_TRACK_SX, 1.76666666666667, -0.51);
    effector:SetKey(_TRACK_SY, 1.76666666666667, 0.51666666666667);
    effector:SetKey(_TRACK_SX, 1.8, 0.5);
    effector:SetKey(_TRACK_SY, 1.8, 0.5);
    effector:SetKey(_TRACK_SX, 2.03333333333333, 0.4);
    effector:SetKey(_TRACK_SY, 2.03333333333333, 0.4);
    effector:SetKey(_TRACK_SX, 2.26666666666667, 0.5);
    effector:SetKey(_TRACK_SY, 2.26666666666667, 0.5);
    effector:SetKey(_TRACK_SX, 2.6, 0.45);
    effector:SetKey(_TRACK_SY, 2.6, 0.45);
    effector:SetKey(_TRACK_SX, 2.76666666666667, 0.5);
    effector:SetKey(_TRACK_SY, 2.76666666666667, 0.5);
    effector:SetKey(_TRACK_SX, 2.93333333333333, 0.45);
    effector:SetKey(_TRACK_SY, 2.93333333333333, 0.45);
    effector:SetKey(_TRACK_SX, 3.13333333333333, 0.5);
    effector:SetKey(_TRACK_SY, 3.13333333333333, 0.5);
    effector:SetKey(_TRACK_SX, 3.43333333333333, 0.55);
    effector:SetKey(_TRACK_SY, 3.43333333333333, 0.55);
    effector:SetKey(_TRACK_SX, 3.66666666666667, 0.45);
    effector:SetKey(_TRACK_SY, 3.66666666666667, 0.45);
    effector:SetKey(_TRACK_SX, 3.7, -0.443);
    effector:SetKey(_TRACK_SY, 3.7, 0.44305555555556);
    effector:SetKey(_TRACK_SX, 4.16666666666667, -0.30414285714286);
    effector:SetKey(_TRACK_SY, 4.16666666666667, 0.30416666666667);
    effector:SetKey(_TRACK_SX, 4.2, 0.3);
    effector:SetKey(_TRACK_SY, 4.2, 0.29920634920635);
    effector:SetKey(_TRACK_SX, 4.86666666666667, 0.2);
    effector:SetKey(_TRACK_SY, 4.86666666666667, 0.2);
    effector:SetKey(_TRACK_SX, 4.9, -0.21);
    effector:SetKey(_TRACK_SY, 4.9, 0.21111111111111);
    effector:SetKey(_TRACK_SX, 5.16666666666667, -0.3);
    effector:SetKey(_TRACK_SY, 5.16666666666667, 0.3);
    effector:SetKey(_TRACK_SX, 5.5, -0.25);
    effector:SetKey(_TRACK_SY, 5.5, 0.25);
    effector:SetKey(_TRACK_SX, 5.7, -0.2875);
    effector:SetKey(_TRACK_SY, 5.7, 0.2875);
    effector:SetKey(_TRACK_SX, 5.73333333333333, 0.294);
    effector:SetKey(_TRACK_SY, 5.73333333333333, 0.29375);
    effector:SetKey(_TRACK_SX, 6.03333333333333, 0.35);
    effector:SetKey(_TRACK_SY, 6.03333333333333, 0.35);
    effector:SetKey(_TRACK_SX, 6.06666666666667, -0.34);
    effector:SetKey(_TRACK_SY, 6.06666666666667, 0.34285714285714);
    effector:SetKey(_TRACK_SX, 6.26666666666667, -0.3);
    effector:SetKey(_TRACK_SY, 6.26666666666667, 0.3);
    effector:SetKey(_TRACK_SX, 6.43333333333333, -0.35);
    effector:SetKey(_TRACK_SY, 6.43333333333333, 0.35);
    effector:SetKey(_TRACK_SX, 6.86666666666667, -0.4);
    effector:SetKey(_TRACK_SY, 6.86666666666667, 0.4);
    effector:SetKey(_TRACK_SX, 7.43333333333333, -0.55);
    effector:SetKey(_TRACK_SY, 7.43333333333333, 0.55);
    effector:SetKey(_TRACK_SX, 7.86666666666667, -0.45);
    effector:SetKey(_TRACK_SY, 7.86666666666667, 0.45);
    effector:SetKey(_TRACK_SX, 8.2, -0.45);
    effector:SetKey(_TRACK_SY, 8.2, 0.45);
    effector:SetKey(_TRACK_SX, 8.63333333333333, -0.5);
    effector:SetKey(_TRACK_SY, 8.63333333333333, 0.5);
    effector:SetKey(_TRACK_SX, 8.93333333333333, -0.55);
    effector:SetKey(_TRACK_SY, 8.93333333333333, 0.55);
    effector:SetKey(_TRACK_SX, 9.2, -0.45);
    effector:SetKey(_TRACK_SY, 9.2, 0.45);
    effector:SetKey(_TRACK_SX, 9.23333333333333, 0.459375);
    effector:SetKey(_TRACK_SY, 9.23333333333333, 0.459375);
    effector:SetKey(_TRACK_SX, 9.73333333333333, 0.6);
    effector:SetKey(_TRACK_SY, 9.73333333333333, 0.6);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 0.36666666666667, 0.40032686220572);
    effector:SetKey(_TRACK_A, 0.83333333333333, -0.04949226924179);
    effector:SetKey(_TRACK_A, 1.13333333333333, 0.0893199154553);
    effector:SetKey(_TRACK_A, 1.53333333333333, 0.65254796584833);
    effector:SetKey(_TRACK_A, 1.8, -0.06689676446388);
    effector:SetKey(_TRACK_A, 2.1, -0.16350256948761);
    effector:SetKey(_TRACK_A, 2.36666666666667, -0.79259744241868);
    effector:SetKey(_TRACK_A, 2.63333333333333, -0.44117969959247);
    effector:SetKey(_TRACK_A, 2.76666666666667, -0.77435035772855);
    effector:SetKey(_TRACK_A, 2.96666666666667, -1.16544373142121);
    effector:SetKey(_TRACK_A, 3.23333333333333, -0.17656027941949);
    effector:SetKey(_TRACK_A, 3.56666666666667, 0.06831792409722);
    effector:SetKey(_TRACK_A, 3.86666666666667, 0.35201140332563);
    effector:SetKey(_TRACK_A, 4.4, -0.04273264473161);
    effector:SetKey(_TRACK_A, 4.73333333333333, 0.15643011463034);
    effector:SetKey(_TRACK_A, 5.23333333333333, -0.04167928354933);
    effector:SetKey(_TRACK_A, 5.5, 0.13934085936757);
    effector:SetKey(_TRACK_A, 5.83333333333333, -0.50801868758775);
    effector:SetKey(_TRACK_A, 6.23333333333333, 0.34145884823895);
    effector:SetKey(_TRACK_A, 6.66666666666667, 0.15844337524343);
    effector:SetKey(_TRACK_A, 6.76666666666667, -0.0948678638987);
    effector:SetKey(_TRACK_A, 6.96666666666667, 0.06824548064975);
    effector:SetKey(_TRACK_A, 7.16666666666667, 0.22605845725735);
    effector:SetKey(_TRACK_A, 7.36666666666667, 0.11781849741269);
    effector:SetKey(_TRACK_A, 7.6, 0.46145950372407);
    effector:SetKey(_TRACK_A, 7.83333333333333, 0.15106768903864);
    effector:SetKey(_TRACK_A, 8.5, 0.45839897661192);
    effector:SetKey(_TRACK_A, 8.73333333333333, 0.04340703017043);
    effector:SetKey(_TRACK_A, 9.3, -0.24197458886459);

    effector:Play();

    compositionHummingBird2:Play();

    return compositionHummingBird2;
end

createCompositionL2Fly = function()

    local compositionL2Fly = CreateCompositionSequence();
    local compositionDuration = 9.96666666666667;
    compositionL2Fly:SetDuration(compositionDuration);


    -- Layer bug1
    local element = auxCreateCompositionElement('data/Texture/Scenes/02_InsideTempleNearTheSea/Animations/Env/Bug_fly[01-02].png');
    element:SetName('bug1');
    compositionL2Fly:AddElement(element);
    element:SetHotSpot(9.5, 9);
    element:SetParentElement(compositionL2Fly);
    element:SetAngle(0);

    effector = element:GetEffector();
    effector:SetLifeTime(0, 10);

    effector:SetKey(_TRACK_X, 0, 567.97297668457);
    effector:SetKey(_TRACK_Y, 0, 805.702697753906);
    effector:SetKey(_TRACK_X, 0.1, 579.97297668457);
    effector:SetKey(_TRACK_Y, 0.1, 753.702697753906);
    effector:SetKey(_TRACK_X, 0.23333333333333, 579.97297668457);
    effector:SetKey(_TRACK_Y, 0.23333333333333, 694.702697753906);
    effector:SetKey(_TRACK_X, 0.36666666666667, 566.97297668457);
    effector:SetKey(_TRACK_Y, 0.36666666666667, 645.702697753906);
    effector:SetKey(_TRACK_X, 0.46666666666667, 548.97297668457);
    effector:SetKey(_TRACK_Y, 0.46666666666667, 601.702697753906);
    effector:SetKey(_TRACK_X, 0.6, 509.97297668457);
    effector:SetKey(_TRACK_Y, 0.6, 568.702697753906);
    effector:SetKey(_TRACK_X, 0.7, 499.97297668457);
    effector:SetKey(_TRACK_Y, 0.7, 524.202697753906);
    effector:SetKey(_TRACK_X, 0.8, 530.47297668457);
    effector:SetKey(_TRACK_Y, 0.8, 488.202697753906);
    effector:SetKey(_TRACK_X, 0.9, 584.47297668457);
    effector:SetKey(_TRACK_Y, 0.9, 476.702697753906);
    effector:SetKey(_TRACK_X, 1, 628.97297668457);
    effector:SetKey(_TRACK_Y, 1, 506.702697753906);
    effector:SetKey(_TRACK_X, 1.1, 643.97297668457);
    effector:SetKey(_TRACK_Y, 1.1, 554.702697753906);
    effector:SetKey(_TRACK_X, 1.23333333333333, 617.97297668457);
    effector:SetKey(_TRACK_Y, 1.23333333333333, 597.202697753906);
    effector:SetKey(_TRACK_X, 1.33333333333333, 571.97297668457);
    effector:SetKey(_TRACK_Y, 1.33333333333333, 598.702697753906);
    effector:SetKey(_TRACK_X, 1.46666666666667, 529.97297668457);
    effector:SetKey(_TRACK_Y, 1.46666666666667, 584.702697753906);
    effector:SetKey(_TRACK_X, 1.6, 484.97297668457);
    effector:SetKey(_TRACK_Y, 1.6, 562.202697753906);
    effector:SetKey(_TRACK_X, 1.73333333333333, 434.47297668457);
    effector:SetKey(_TRACK_Y, 1.73333333333333, 552.702697753906);
    effector:SetKey(_TRACK_X, 1.83333333333333, 388.97297668457);
    effector:SetKey(_TRACK_Y, 1.83333333333333, 549.702697753906);
    effector:SetKey(_TRACK_X, 1.93333333333333, 332.97297668457);
    effector:SetKey(_TRACK_Y, 1.93333333333333, 549.702697753906);
    effector:SetKey(_TRACK_X, 2.06666666666667, 269.47297668457);
    effector:SetKey(_TRACK_Y, 2.06666666666667, 558.202697753906);
    effector:SetKey(_TRACK_X, 2.16666666666667, 241.47297668457);
    effector:SetKey(_TRACK_Y, 2.16666666666667, 585.202697753906);
    effector:SetKey(_TRACK_X, 2.23333333333333, 233.47297668457);
    effector:SetKey(_TRACK_Y, 2.23333333333333, 611.202697753906);
    effector:SetKey(_TRACK_X, 2.26666666666667, 253.855705448918);
    effector:SetKey(_TRACK_Y, 2.26666666666667, 619.576871408033);
    effector:SetKey(_TRACK_X, 2.36666666666667, 312.97297668457);
    effector:SetKey(_TRACK_Y, 2.36666666666667, 602.702697753906);
    effector:SetKey(_TRACK_X, 2.5, 357.97297668457);
    effector:SetKey(_TRACK_Y, 2.5, 569.702697753906);
    effector:SetKey(_TRACK_X, 2.63333333333333, 401.97297668457);
    effector:SetKey(_TRACK_Y, 2.63333333333333, 511.702697753906);
    effector:SetKey(_TRACK_X, 2.76666666666667, 430.97297668457);
    effector:SetKey(_TRACK_Y, 2.76666666666667, 441.702697753906);
    effector:SetKey(_TRACK_X, 2.93333333333333, 436.97297668457);
    effector:SetKey(_TRACK_Y, 2.93333333333333, 361.702697753906);
    effector:SetKey(_TRACK_X, 3.1, 411.97297668457);
    effector:SetKey(_TRACK_Y, 3.1, 298.702697753906);
    effector:SetKey(_TRACK_X, 3.3, 371.97297668457);
    effector:SetKey(_TRACK_Y, 3.3, 262.702697753906);
    effector:SetKey(_TRACK_X, 3.43333333333333, 392.97297668457);
    effector:SetKey(_TRACK_Y, 3.43333333333333, 251.702697753906);
    effector:SetKey(_TRACK_X, 3.56666666666667, 438.97297668457);
    effector:SetKey(_TRACK_Y, 3.56666666666667, 244.702697753906);
    effector:SetKey(_TRACK_X, 3.66666666666667, 471.97297668457);
    effector:SetKey(_TRACK_Y, 3.66666666666667, 250.702697753906);
    effector:SetKey(_TRACK_X, 3.83333333333333, 521.97297668457);
    effector:SetKey(_TRACK_Y, 3.83333333333333, 276.702697753906);
    effector:SetKey(_TRACK_X, 4, 584.97297668457);
    effector:SetKey(_TRACK_Y, 4, 328.702697753906);
    effector:SetKey(_TRACK_X, 4.2, 664.97297668457);
    effector:SetKey(_TRACK_Y, 4.2, 389.702697753906);
    effector:SetKey(_TRACK_X, 4.4, 762.97297668457);
    effector:SetKey(_TRACK_Y, 4.4, 440.702697753906);
    effector:SetKey(_TRACK_X, 4.56666666666667, 856.750302864722);
    effector:SetKey(_TRACK_Y, 4.56666666666667, 442.59166506394);
    effector:SetKey(_TRACK_X, 4.7, 929.97297668457);
    effector:SetKey(_TRACK_Y, 4.7, 411.702697753906);
    effector:SetKey(_TRACK_X, 4.86666666666667, 950.97297668457);
    effector:SetKey(_TRACK_Y, 4.86666666666667, 353.702697753906);
    effector:SetKey(_TRACK_X, 5.03333333333333, 953.97297668457);
    effector:SetKey(_TRACK_Y, 5.03333333333333, 293.702697753906);
    effector:SetKey(_TRACK_X, 5.16666666666667, 925.97297668457);
    effector:SetKey(_TRACK_Y, 5.16666666666667, 236.702697753906);
    effector:SetKey(_TRACK_X, 5.3, 880.97297668457);
    effector:SetKey(_TRACK_Y, 5.3, 202.702697753906);
    effector:SetKey(_TRACK_X, 5.5, 798.97297668457);
    effector:SetKey(_TRACK_Y, 5.5, 184.702697753906);
    effector:SetKey(_TRACK_X, 5.66666666666667, 720.97297668457);
    effector:SetKey(_TRACK_Y, 5.66666666666667, 186.702697753906);
    effector:SetKey(_TRACK_X, 5.83333333333333, 674.97297668457);
    effector:SetKey(_TRACK_Y, 5.83333333333333, 211.702697753906);
    effector:SetKey(_TRACK_X, 6.06666666666667, 635.97297668457);
    effector:SetKey(_TRACK_Y, 6.06666666666667, 260.702697753906);
    effector:SetKey(_TRACK_X, 6.26666666666667, 638.97297668457);
    effector:SetKey(_TRACK_Y, 6.26666666666667, 314.702697753906);
    effector:SetKey(_TRACK_X, 6.43333333333333, 673.97297668457);
    effector:SetKey(_TRACK_Y, 6.43333333333333, 375.702697753906);
    effector:SetKey(_TRACK_X, 6.6, 744.97297668457);
    effector:SetKey(_TRACK_Y, 6.6, 398.702697753906);
    effector:SetKey(_TRACK_X, 6.73333333333333, 808.97297668457);
    effector:SetKey(_TRACK_Y, 6.73333333333333, 382.702697753906);
    effector:SetKey(_TRACK_X, 6.93333333333333, 838.97297668457);
    effector:SetKey(_TRACK_Y, 6.93333333333333, 335.702697753906);
    effector:SetKey(_TRACK_X, 7.06666666666667, 815.97297668457);
    effector:SetKey(_TRACK_Y, 7.06666666666667, 275.702697753906);
    effector:SetKey(_TRACK_X, 7.23333333333333, 744.97297668457);
    effector:SetKey(_TRACK_Y, 7.23333333333333, 251.702697753906);
    effector:SetKey(_TRACK_X, 7.36666666666667, 685.97297668457);
    effector:SetKey(_TRACK_Y, 7.36666666666667, 271.702697753906);
    effector:SetKey(_TRACK_X, 7.53333333333333, 662.97297668457);
    effector:SetKey(_TRACK_Y, 7.53333333333333, 326.702697753906);
    effector:SetKey(_TRACK_X, 7.7, 681.97297668457);
    effector:SetKey(_TRACK_Y, 7.7, 397.702697753906);
    effector:SetKey(_TRACK_X, 7.83333333333333, 668.97297668457);
    effector:SetKey(_TRACK_Y, 7.83333333333333, 426.702697753906);
    effector:SetKey(_TRACK_X, 8.03333333333333, 637.97297668457);
    effector:SetKey(_TRACK_Y, 8.03333333333333, 444.702697753906);
    effector:SetKey(_TRACK_X, 8.23333333333333, 555.97297668457);
    effector:SetKey(_TRACK_Y, 8.23333333333333, 440.202697753906);
    effector:SetKey(_TRACK_X, 8.43333333333333, 495.47297668457);
    effector:SetKey(_TRACK_Y, 8.43333333333333, 406.702697753906);
    effector:SetKey(_TRACK_X, 8.63333333333333, 465.47297668457);
    effector:SetKey(_TRACK_Y, 8.63333333333333, 358.702697753906);
    effector:SetKey(_TRACK_X, 9.03333333333333, 465.47297668457);
    effector:SetKey(_TRACK_Y, 9.03333333333333, 358.702697753906);
    effector:SetKey(_TRACK_X, 9.2, 513.97297668457);
    effector:SetKey(_TRACK_Y, 9.2, 347.202697753906);
    effector:SetKey(_TRACK_X, 9.6, 513.97297668457);
    effector:SetKey(_TRACK_Y, 9.6, 347.202697753906);
    effector:SetKey(_TRACK_X, 9.7, 501.97297668457);
    effector:SetKey(_TRACK_Y, 9.7, 393.702697753906);
    effector:SetKey(_TRACK_X, 9.8, 477.47297668457);
    effector:SetKey(_TRACK_Y, 9.8, 437.202697753906);
    effector:SetKey(_TRACK_X, 9.93333333333333, 446.97297668457);
    effector:SetKey(_TRACK_Y, 9.93333333333333, 467.702697753906);
    effector:SetKey(_TRACK_SX, 0, 1.5);
    effector:SetKey(_TRACK_SY, 0, 1.5);
    effector:SetKey(_TRACK_SX, 2.16666666666667, 1);
    effector:SetKey(_TRACK_SY, 2.16666666666667, 1);
    effector:SetKey(_TRACK_SX, 3.33333333333333, 0.6);
    effector:SetKey(_TRACK_SY, 3.33333333333333, 0.6);
    effector:SetKey(_TRACK_SX, 4.43333333333333, 0.9);
    effector:SetKey(_TRACK_SY, 4.43333333333333, 0.9);
    effector:SetKey(_TRACK_SX, 5.93333333333333, 1);
    effector:SetKey(_TRACK_SY, 5.93333333333333, 1);
    effector:SetKey(_TRACK_SX, 7.7, 0.8);
    effector:SetKey(_TRACK_SY, 7.7, 0.8);
    effector:SetKey(_TRACK_SX, 8.7, 1);
    effector:SetKey(_TRACK_SY, 8.7, 1);
    effector:SetKey(_TRACK_SX, 9.96666666666667, 0.8);
    effector:SetKey(_TRACK_SY, 9.96666666666667, 0.8);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 1.8, 1);
    effector:SetKey(_TRACK_O, 1.83333333333333, 0);
    effector:SetKey(_TRACK_O, 2.13333333333333, 0);
    effector:SetKey(_TRACK_O, 2.16666666666667, 1);
    effector:SetKey(_TRACK_O, 3.36666666666667, 1);
    effector:SetKey(_TRACK_O, 3.4, 0);
    effector:SetKey(_TRACK_O, 3.63333333333333, 0);
    effector:SetKey(_TRACK_O, 3.66666666666667, 1);
    effector:SetKey(_TRACK_O, 5.13333333333333, 1);
    effector:SetKey(_TRACK_O, 5.16666666666667, 0);
    effector:SetKey(_TRACK_O, 5.6, 0);
    effector:SetKey(_TRACK_O, 5.63333333333333, 0.6);
    effector:SetKey(_TRACK_O, 5.66666666666667, 0);
    effector:SetKey(_TRACK_O, 5.73333333333333, 0);
    effector:SetKey(_TRACK_O, 5.76666666666667, 1);
    effector:SetKey(_TRACK_O, 9.83333333333333, 1);
    effector:SetKey(_TRACK_O, 9.86666666666667, 0);
    effector:SetKey(_TRACK_O, 9.96666666666667, 0);

    effector:Play();

    compositionL2Fly:Play();

    return compositionL2Fly;
end

