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

--// 1.	rename:					" -> '
--// 2. comment root compositions routines:
--//	"createCompositionNear_the_Helicopter_Items = function()"
--// 2.1. remove dynamite sprite from exploding composition (with texture "dinamit_pl.png")
--// 3. add auxiliaru routines for managing animations: 
--		auxPlayNearTheCopterAnimation(), 
--		auxGetNearTheCopterAnimation(), 
--		auxCreateNearTheCopterAnimations()
--// 4. replace CreateCompositionElement() with auxCreateCompositionElement() for some corrections ...

------------------------------------------------------------------------------
--
function auxPlayNearTheCopterAnimation(compositionName)
    local composition = auxGetNearTheCopterAnimation(compositionName);
    composition:SetVisible(true);
    composition:Play();
end

------------------------------------------------------------------------------
--
function auxHideNearTheCopterAnimation(compositionName)
    local composition = auxGetNearTheCopterAnimation(compositionName);
    composition:Stop();
    composition:SetVisible(false);
end

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

    return nearTheCopterCompositions[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/25_NearTheCopter/Animations/') + 1);

	--// set up saegulls animation
	if (texName == 'Env/sg_[0000-0009].png') then
		local anim = element:GetTexture();
		anim:Stop();
		anim:SetTextureRect(0,0, 40,22);
		anim:SetFrames(10);
		anim:SetFrame(0);
		anim:SetSpeed(30.0);
		anim:SetMode(HGEANIM_FWD + HGEANIM_LOOP);
		anim:Play();
    end
    --// set up crab animation
	if (texName == 'Env/Crab_[0000-0007].png') then
		local anim = element:GetTexture();
		anim:Stop();
		anim:SetTextureRect(0,0, 108,101);
		anim:SetFrames(8);
		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_burn01.jpg' or
		texName == 'Env/EF_burn02.jpg' or
		texName == 'Env/EF_burn03.jpg' or
		texName == 'Env/EF_fire1.jpg' or
		texName == 'Env/EF_fire2.jpg' or
		texName == 'Env/EF_fire3.jpg' or
		texName == 'Env/EF_light02.jpg' or
		texName == 'Env/EF_sparkles.jpg') then

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

------------------------------------------------------------------------------
--
function auxCreateNearTheCopterAnimations(parent)
    assert(parent ~= nil);

    nearTheCopterCompositions = {};
    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);
        nearTheCopterCompositions[element:GetName()] = element;
    end

	--// Env
    CreateAndRegisterComposition(parent, createCompositionEnvTop,		'EnvTop',		0,0,108, 512,384, 10, true);
    CreateAndRegisterComposition(parent, createCompositionCrab1,		'Crab1',		0,0,107, 512,384, 10, false);
    CreateAndRegisterComposition(parent, createCompositionCrab2,		'Crab2',		0,0,107, 512,384, 10, false);
    CreateAndRegisterComposition(parent, createCompositionBalloon,		'Balloon',		0,0,106, 512,384, 10, false);
auxGetNearTheCopterAnimation('Balloon'):SetSpeed(0.25);
    CreateAndRegisterComposition(parent, createCompositionSeagull,		'Seagull',		0,0,105, 512,384, 10, false);
    CreateAndRegisterComposition(parent, createCompositionBurningEmbers,'BurningEmbers',0,0,104, 512,384, 10, true);
    CreateAndRegisterComposition(parent, createCompositionWood,			'Wood',			0,0,103, 512,384, 10, true);
    CreateAndRegisterComposition(parent, createCompositionPilot,		'Pilot',		0,0,101, 512,384, 10, true);
end

------------------------------------------------------------------------------
-- 
--createCompositionNear_the_Helicopter_Items = function()
--
--    local compositionNear_the_Helicopter_Items = CreateCompositionSequence();
--    local compositionDuration = 10;
--    compositionNear_the_Helicopter_Items:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = createCompositionEnvTop();
--    element:SetName('Layer_1');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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 = createCompositionCrab1();
--    element:SetName('Layer_2');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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 = createCompositionCrab2();
--    element:SetName('Layer_3');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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 = createCompositionBalloon();
--    element:SetName('Layer_4');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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_5
--    local element = createCompositionSeagull();
--    element:SetName('Layer_5');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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_6
--    local element = createCompositionBurningEmbers();
--    element:SetName('Layer_6');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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_7
--    local element = createCompositionWood();
--    element:SetName('Layer_7');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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_8
--    local element = createCompositionPilot();
--    element:SetName('Layer_8');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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_9
--    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Near_the_Helicopter_Items.jpg');
--    element:SetName('Layer_9');
--    compositionNear_the_Helicopter_Items:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(compositionNear_the_Helicopter_Items);
--    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();
--
--    compositionNear_the_Helicopter_Items:Play();
--
--    return compositionNear_the_Helicopter_Items;
--end

createCompositionBalloon = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/balloon.png');
    element:SetName('Layer_1');
    compositionBalloon:AddElement(element);
    element:SetHotSpot(79, 98);
    element:SetParentElement(compositionBalloon);
    element:SetAngle(0);
    element:SetOpacity(1);

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

    effector:SetKey(_TRACK_X, 0, -72.6486511230469);
    effector:SetKey(_TRACK_Y, 0, -159.567565917969);
    effector:SetKey(_TRACK_X, 0.4180078125, -12.9729766845703);
    effector:SetKey(_TRACK_Y, 0.4180078125, -129.729721069336);
    effector:SetKey(_TRACK_X, 0.940546875, 73.9459381103516);
    effector:SetKey(_TRACK_Y, 0.940546875, -105.081085205078);
    effector:SetKey(_TRACK_X, 1.463046875, 159.567565917969);
    effector:SetKey(_TRACK_Y, 1.463046875, -111.567565917969);
    effector:SetKey(_TRACK_X, 2.090078125, 242.594604492188);
    effector:SetKey(_TRACK_Y, 2.090078125, -110.270263671875);
    effector:SetKey(_TRACK_X, 2.6648828125, 325.621627807617);
    effector:SetKey(_TRACK_Y, 2.6648828125, -97.2972869873047);
    effector:SetKey(_TRACK_X, 3.1873828125, 394.378372192383);
    effector:SetKey(_TRACK_Y, 3.1873828125, -60.9729766845703);
    effector:SetKey(_TRACK_X, 3.7621484375, 443.675674438477);
    effector:SetKey(_TRACK_Y, 3.7621484375, -18.1621704101563);
    effector:SetKey(_TRACK_X, 4.3891796875, 485.189193725586);
    effector:SetKey(_TRACK_Y, 4.3891796875, 19.4594573974609);
    effector:SetKey(_TRACK_X, 5.1207421875, 534.486480712891);
    effector:SetKey(_TRACK_Y, 5.1207421875, 63.5675659179688);
    effector:SetKey(_TRACK_X, 5.9567578125, 601.945938110352);
    effector:SetKey(_TRACK_Y, 5.9567578125, 93.4054107666016);
    effector:SetKey(_TRACK_X, 7.106328125, 671.621612548828);
    effector:SetKey(_TRACK_Y, 7.106328125, 101.013519287109);
    effector:SetKey(_TRACK_X, 9.9279296875, 750.02702331543);
    effector:SetKey(_TRACK_Y, 9.9279296875, 75.9999847412109);
    effector:SetKey(_TRACK_SX, 0, 2);
    effector:SetKey(_TRACK_SY, 0, 2);
    effector:SetKey(_TRACK_SX, 5.9567578125, 1);
    effector:SetKey(_TRACK_SY, 5.9567578125, 1);
    effector:SetKey(_TRACK_SX, 9.96, 0.3);
    effector:SetKey(_TRACK_SY, 9.96, 0.3);

    effector:Play();

    compositionBalloon:Play();

    return compositionBalloon;
end

createCompositionBurningEmbers = function()

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


    -- Layer Layer_1
    local element = createCompositionSparkles_all();
    element:SetName('Layer_1');
    compositionBurningEmbers:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionBurningEmbers);
    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 = createCompositionFire_all();
    element:SetName('Layer_2');
    compositionBurningEmbers:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionBurningEmbers);
    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 = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_fire3.jpg');
    element:SetName('Layer_3');
    compositionBurningEmbers:AddElement(element);
    element:SetHotSpot(72, 41);
    element:SetParentElement(compositionBurningEmbers);
    element:SetXY(336.5, 567);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.8, 0.4);
    effector:SetKey(_TRACK_O, 1.28, 0);
    effector:SetKey(_TRACK_O, 1.96, 0.2);
    effector:SetKey(_TRACK_O, 2.56, 0);
    effector:SetKey(_TRACK_O, 3.2, 0.40000000256092);
    effector:SetKey(_TRACK_O, 3.92, 0);
    effector:SetKey(_TRACK_O, 4.76, 0.2);
    effector:SetKey(_TRACK_O, 5.6, 0);
    effector:SetKey(_TRACK_O, 6.36, 0.40000000512183);
    effector:SetKey(_TRACK_O, 7.08, 0);
    effector:SetKey(_TRACK_O, 7.68, 0.20000000256092);
    effector:SetKey(_TRACK_O, 8.2, 0);
    effector:SetKey(_TRACK_O, 8.76, 0.33952447987194);
    effector:SetKey(_TRACK_O, 9.2, 0);
    effector:SetKey(_TRACK_O, 9.48, 0.1);
    effector:SetKey(_TRACK_O, 9.96, 0);

    effector:Play();


    -- Layer Layer_4
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_fire2.jpg');
    element:SetName('Layer_4');
    compositionBurningEmbers:AddElement(element);
    element:SetHotSpot(70.5, 43.5);
    element:SetParentElement(compositionBurningEmbers);
    element:SetXY(334, 554.5);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 0.8);
    effector:SetKey(_TRACK_O, 0.36, 0.2);
    effector:SetKey(_TRACK_O, 0.48, 1);
    effector:SetKey(_TRACK_O, 0.76, 0.2);
    effector:SetKey(_TRACK_O, 1.2, 1);
    effector:SetKey(_TRACK_O, 1.44, 0.2);
    effector:SetKey(_TRACK_O, 1.76, 0.8);
    effector:SetKey(_TRACK_O, 2, 0.2);
    effector:SetKey(_TRACK_O, 2.32, 1);
    effector:SetKey(_TRACK_O, 2.56, 0.2);
    effector:SetKey(_TRACK_O, 2.96, 0.6);
    effector:SetKey(_TRACK_O, 3.12, 0.1);
    effector:SetKey(_TRACK_O, 3.44, 1);
    effector:SetKey(_TRACK_O, 3.72, 0.4);
    effector:SetKey(_TRACK_O, 3.92, 0.8);
    effector:SetKey(_TRACK_O, 4.16, 0.2);
    effector:SetKey(_TRACK_O, 4.52, 1);
    effector:SetKey(_TRACK_O, 4.8, 0.2);
    effector:SetKey(_TRACK_O, 5.04, 0.8);
    effector:SetKey(_TRACK_O, 5.32, 0.1);
    effector:SetKey(_TRACK_O, 5.52, 1);
    effector:SetKey(_TRACK_O, 5.8, 0.4);
    effector:SetKey(_TRACK_O, 5.96, 0.8);
    effector:SetKey(_TRACK_O, 6.2, 0.1);
    effector:SetKey(_TRACK_O, 6.48, 1);
    effector:SetKey(_TRACK_O, 6.68, 0.2);
    effector:SetKey(_TRACK_O, 6.92, 1);
    effector:SetKey(_TRACK_O, 7.12, 0.2);
    effector:SetKey(_TRACK_O, 7.4, 0.4);
    effector:SetKey(_TRACK_O, 7.64, 0.2);
    effector:SetKey(_TRACK_O, 7.92, 0.8);
    effector:SetKey(_TRACK_O, 8.12, 0.2);
    effector:SetKey(_TRACK_O, 8.32, 1);
    effector:SetKey(_TRACK_O, 8.56, 0.2);
    effector:SetKey(_TRACK_O, 8.68, 0.8);
    effector:SetKey(_TRACK_O, 8.92, 0.2);
    effector:SetKey(_TRACK_O, 9.08, 1);
    effector:SetKey(_TRACK_O, 9.28, 0.2);
    effector:SetKey(_TRACK_O, 9.48, 0.8);
    effector:SetKey(_TRACK_O, 9.64, 0.2);
    effector:SetKey(_TRACK_O, 9.84, 0.8);
    effector:SetKey(_TRACK_O, 9.96, 0);

    effector:Play();


    -- Layer Layer_5
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_fire1.jpg');
    element:SetName('Layer_5');
    compositionBurningEmbers:AddElement(element);
    element:SetHotSpot(70.5, 45.5);
    element:SetParentElement(compositionBurningEmbers);
    element:SetXY(334, 557);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_O, 0, 0.8);
    effector:SetKey(_TRACK_O, 0.64, 1);
    effector:SetKey(_TRACK_O, 1.32, 0.8);
    effector:SetKey(_TRACK_O, 2.28, 1);
    effector:SetKey(_TRACK_O, 3.24, 0.8);
    effector:SetKey(_TRACK_O, 4.2, 1);
    effector:SetKey(_TRACK_O, 4.88, 0.8);
    effector:SetKey(_TRACK_O, 5.36, 1);
    effector:SetKey(_TRACK_O, 5.72, 0.8);
    effector:SetKey(_TRACK_O, 6.2, 1);
    effector:SetKey(_TRACK_O, 6.72, 0.8);
    effector:SetKey(_TRACK_O, 7.6, 1);
    effector:SetKey(_TRACK_O, 8.36, 0.8);
    effector:SetKey(_TRACK_O, 8.92, 1);
    effector:SetKey(_TRACK_O, 9.96, 0.8);

    effector:Play();

    compositionBurningEmbers:Play();

    return compositionBurningEmbers;
end

createCompositionCrab1 = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Crab_[0000-0007].png');
    element:SetName('Layer_1');
    compositionCrab1:AddElement(element);
    element:SetHotSpot(54, 50.5);
    element:SetParentElement(compositionCrab1);
    element:SetScaleX(0.67564713290405);
    element:SetScaleY(0.80718959376128);
    element:SetOpacity(1);

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

    effector:SetKey(_TRACK_X, 0, 170.161651611328);
    effector:SetKey(_TRACK_Y, 0, 800.96354675293);
    effector:SetKey(_TRACK_X, 0.36, 205.161651611328);
    effector:SetKey(_TRACK_Y, 0.36, 775.96354675293);
    effector:SetKey(_TRACK_X, 0.8, 257.161651611328);
    effector:SetKey(_TRACK_Y, 0.8, 757.96354675293);
    effector:SetKey(_TRACK_X, 1.36, 324.161651611328);
    effector:SetKey(_TRACK_Y, 1.36, 760.96354675293);
    effector:SetKey(_TRACK_X, 1.88, 387.161651611328);
    effector:SetKey(_TRACK_Y, 1.88, 752.96354675293);
    effector:SetKey(_TRACK_X, 2.6, 465.161651611328);
    effector:SetKey(_TRACK_Y, 2.6, 757.96354675293);
    effector:SetKey(_TRACK_X, 3.68, 573.161651611328);
    effector:SetKey(_TRACK_Y, 3.68, 805.96354675293);
    effector:SetKey(_TRACK_A, 0, -0.34461852974874);
    effector:SetKey(_TRACK_A, 0.68, -0.20923411659026);
    effector:SetKey(_TRACK_A, 0.96, 0.00677459716326);
    effector:SetKey(_TRACK_A, 1.44, -0.18527678017657);
    effector:SetKey(_TRACK_A, 1.92, 0.03097654894794);
    effector:SetKey(_TRACK_A, 2.48, 0.31743395562551);

    effector:Play();

    compositionCrab1:Play();

    return compositionCrab1;
end

createCompositionCrab2 = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Crab_[0000-0007].png');
    element:SetName('Layer_1');
    compositionCrab2:AddElement(element);
    element:SetHotSpot(54, 50.5);
    element:SetParentElement(compositionCrab2);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_X, 0, 691.209197998047);
    effector:SetKey(_TRACK_Y, 0, 362.522979736328);
    effector:SetKey(_TRACK_X, 0.24, 678.709197998047);
    effector:SetKey(_TRACK_Y, 0.24, 366.022979736328);
    effector:SetKey(_TRACK_X, 0.44, 668.209197998047);
    effector:SetKey(_TRACK_Y, 0.44, 366.522979736328);
    effector:SetKey(_TRACK_X, 0.76, 655.209197998047);
    effector:SetKey(_TRACK_Y, 0.76, 365.022979736328);
    effector:SetKey(_TRACK_X, 1.04, 642.709197998047);
    effector:SetKey(_TRACK_Y, 1.04, 361.772979736328);
    effector:SetKey(_TRACK_X, 1.28, 630.209197998047);
    effector:SetKey(_TRACK_Y, 1.28, 361.022979736328);
    effector:SetKey(_TRACK_X, 1.56, 617.709197998047);
    effector:SetKey(_TRACK_Y, 1.56, 364.272979736328);
    effector:SetKey(_TRACK_X, 1.8, 603.959197998047);
    effector:SetKey(_TRACK_Y, 1.8, 366.272979736328);
    effector:SetKey(_TRACK_X, 2.04, 589.959197998047);
    effector:SetKey(_TRACK_Y, 2.04, 365.272979736328);
    effector:SetKey(_TRACK_X, 2.32, 577.459197998047);
    effector:SetKey(_TRACK_Y, 2.32, 363.772979736328);
    effector:SetKey(_TRACK_X, 2.6, 562.709197998047);
    effector:SetKey(_TRACK_Y, 2.6, 364.522979736328);
    effector:SetKey(_TRACK_X, 2.88, 550.459197998047);
    effector:SetKey(_TRACK_Y, 2.88, 368.272979736328);
    effector:SetKey(_TRACK_X, 3.16, 536.209197998047);
    effector:SetKey(_TRACK_Y, 3.16, 372.772979736328);
    effector:SetKey(_TRACK_X, 3.48, 518.959197998047);
    effector:SetKey(_TRACK_Y, 3.48, 374.772979736328);
    effector:SetKey(_TRACK_X, 3.84, 498.709197998047);
    effector:SetKey(_TRACK_Y, 3.84, 376.272979736328);
    effector:SetKey(_TRACK_X, 4.16, 478.334197998047);
    effector:SetKey(_TRACK_Y, 4.16, 376.397979736328);
    effector:SetKey(_TRACK_X, 4.56, 457.209197998047);
    effector:SetKey(_TRACK_Y, 4.56, 374.147979736328);
    effector:SetKey(_TRACK_X, 4.96, 437.459197998047);
    effector:SetKey(_TRACK_Y, 4.96, 371.022979736328);
    effector:SetKey(_TRACK_X, 5.32, 417.709197998047);
    effector:SetKey(_TRACK_Y, 5.32, 368.897979736328);
    effector:SetKey(_TRACK_X, 5.76, 391.209197998047);
    effector:SetKey(_TRACK_Y, 5.76, 366.647979736328);
    effector:SetKey(_TRACK_SX, 0, -0.1);
    effector:SetKey(_TRACK_SY, 0, 0.1);
    effector:SetKey(_TRACK_SX, 0.8, -0.2);
    effector:SetKey(_TRACK_SY, 0.8, 0.2);
    effector:SetKey(_TRACK_SX, 2.16, -0.1);
    effector:SetKey(_TRACK_SY, 2.16, 0.1);
    effector:SetKey(_TRACK_SX, 3.4, -0.2);
    effector:SetKey(_TRACK_SY, 3.4, 0.2);
    effector:SetKey(_TRACK_SX, 5.8, -0.15);
    effector:SetKey(_TRACK_SY, 5.8, 0.15);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 1);
    effector:SetKey(_TRACK_O, 5.44, 1);
    effector:SetKey(_TRACK_O, 5.52, 0);

    effector:Play();

    compositionCrab2:Play();

    return compositionCrab2;
end

createCompositionEnvTop = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_light02.jpg');
    element:SetName('Layer_1');
    compositionEnvTop:AddElement(element);
    element:SetHotSpot(107, 83);
    element:SetParentElement(compositionEnvTop);
    element:SetXY(544.393035888672, 279.923934936523);

    element:SetScaleX(4.75103703050628);
    element:SetScaleY(6.79645442771962);
    element:SetAngle(-0.54538135275256);

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

    effector:SetKey(_TRACK_O, 0, 0.4);
    effector:SetKey(_TRACK_O, 1, 1);
    effector:SetKey(_TRACK_O, 1.8, 0.2);
    effector:SetKey(_TRACK_O, 2.48, 0.8);
    effector:SetKey(_TRACK_O, 3.24, 0.1);
    effector:SetKey(_TRACK_O, 4.24, 0.6);
    effector:SetKey(_TRACK_O, 5.04, 0.2);
    effector:SetKey(_TRACK_O, 6, 0.8);
    effector:SetKey(_TRACK_O, 7, 0.2);
    effector:SetKey(_TRACK_O, 8.2, 0.8);
    effector:SetKey(_TRACK_O, 9.04, 0.2);
    effector:SetKey(_TRACK_O, 9.96, 0.4);

    effector:Play();


    -- Layer Layer_2
    local element = createCompositionWaves_all();
    element:SetName('Layer_2');
    compositionEnvTop:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionEnvTop);
    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();

    compositionEnvTop:Play();

    return compositionEnvTop;
end

createCompositionFire_01 = function()

    local compositionFire_01 = CreateCompositionSequence();
    local compositionDuration = 0.88;
    compositionFire_01:SetDuration(compositionDuration);


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_burn03.jpg');
    element:SetName('Layer_1');
    compositionFire_01:AddElement(element);
    element:SetHotSpot(17.2975158691406, 82.6363677978516);
    element:SetParentElement(compositionFire_01);
    element:SetXY(50.2868499755859, 81.8732147216797);

    element:SetAngle(0);

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

    effector:SetKey(_TRACK_SX, 0, 0.37135099678974);
    effector:SetKey(_TRACK_SY, 0, 0.20737077698975);
    effector:SetKey(_TRACK_SX, 0.2, 0.37135099678974);
    effector:SetKey(_TRACK_SY, 0.2, 0.20737077698975);
    effector:SetKey(_TRACK_SX, 0.24, 0.58090066452649);
    effector:SetKey(_TRACK_SY, 0.24, 0.27392742930359);
    effector:SetKey(_TRACK_SX, 0.28, 0.88025733272185);
    effector:SetKey(_TRACK_SY, 0.28, 0.39493952441966);
    effector:SetKey(_TRACK_SX, 0.32, 0.94012866636092);
    effector:SetKey(_TRACK_SY, 0.32, 0.4614961767335);
    effector:SetKey(_TRACK_SX, 0.36, 0.79045033226324);
    effector:SetKey(_TRACK_SY, 0.36, 0.52805282904733);
    effector:SetKey(_TRACK_SX, 0.4, 0.7605146654437);
    effector:SetKey(_TRACK_SY, 0.4, 0.68536855269822);
    effector:SetKey(_TRACK_SX, 0.44, 0.64077199816555);
    effector:SetKey(_TRACK_SY, 0.44, 0.85478548586072);
    effector:SetKey(_TRACK_SX, 0.48, 0.49109366406787);
    effector:SetKey(_TRACK_SY, 0.48, 0.85478548586072);
    effector:SetKey(_TRACK_SX, 0.52, 0.67070766498509);
    effector:SetKey(_TRACK_SY, 0.52, 0.71562157647724);
    effector:SetKey(_TRACK_SX, 0.56, 0.88025733272184);
    effector:SetKey(_TRACK_SY, 0.56, 0.66721673843081);
    effector:SetKey(_TRACK_SX, 0.6, 0.7605146654437);
    effector:SetKey(_TRACK_SY, 0.6, 0.55225524807055);
    effector:SetKey(_TRACK_SX, 0.64, 0.61083633134601);
    effector:SetKey(_TRACK_SY, 0.64, 0.4554455719777);
    effector:SetKey(_TRACK_SX, 0.68, 0.61083633134601);
    effector:SetKey(_TRACK_SY, 0.68, 0.35863589588484);
    effector:SetKey(_TRACK_SX, 0.72, 0.37135099678972);
    effector:SetKey(_TRACK_SY, 0.72, 0.18921896272234);
    effector:SetKey(_TRACK_SX, 0.76, 0.28154399633111);
    effector:SetKey(_TRACK_SY, 0.76, 0.15896593894333);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 0);
    effector:SetKey(_TRACK_O, 0.4, 1);
    effector:SetKey(_TRACK_O, 0.76, 0);

    effector:Play();


    -- Layer Layer_2
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_burn02.jpg');
    element:SetName('Layer_2');
    compositionFire_01:AddElement(element);
    element:SetHotSpot(16.75, 67);
    element:SetParentElement(compositionFire_01);
    element:SetXY(35.003173828125, 73.8272552490234);

    element:SetAngle(0);

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

    effector:SetKey(_TRACK_SX, 0, 0.47692307692308);
    effector:SetKey(_TRACK_SY, 0, 0.28358208955224);
    effector:SetKey(_TRACK_SX, 0.2, 0.47692307692308);
    effector:SetKey(_TRACK_SY, 0.2, 0.28358208955224);
    effector:SetKey(_TRACK_SX, 0.24, 0.84615384615384);
    effector:SetKey(_TRACK_SY, 0.24, 0.38805970149254);
    effector:SetKey(_TRACK_SX, 0.28, 1.33846153846154);
    effector:SetKey(_TRACK_SY, 0.28, 0.51492537313433);
    effector:SetKey(_TRACK_SX, 0.32, 1.18461538461538);
    effector:SetKey(_TRACK_SY, 0.32, 0.70149253731343);
    effector:SetKey(_TRACK_SX, 0.36, 0.81538461538462);
    effector:SetKey(_TRACK_SY, 0.36, 0.83582089552239);
    effector:SetKey(_TRACK_SX, 0.4, 0.44615384615385);
    effector:SetKey(_TRACK_SY, 0.4, 0.88805970149254);
    effector:SetKey(_TRACK_SX, 0.44, 0.53846153846154);
    effector:SetKey(_TRACK_SY, 0.44, 0.76865671641791);
    effector:SetKey(_TRACK_SX, 0.48, 0.53846153846154);
    effector:SetKey(_TRACK_SY, 0.48, 0.73880597014925);
    effector:SetKey(_TRACK_SX, 0.52, 0.50769230769231);
    effector:SetKey(_TRACK_SY, 0.52, 0.63432835820895);
    effector:SetKey(_TRACK_SX, 0.56, 0.50769230769231);
    effector:SetKey(_TRACK_SY, 0.56, 0.52238805970149);
    effector:SetKey(_TRACK_SX, 0.6, 0.35384615384615);
    effector:SetKey(_TRACK_SY, 0.6, 0.31343283582089);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.2, 0);
    effector:SetKey(_TRACK_O, 0.36, 1);
    effector:SetKey(_TRACK_O, 0.6, 0);

    effector:Play();


    -- Layer Layer_3
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_burn01.jpg');
    element:SetName('Layer_3');
    compositionFire_01:AddElement(element);
    element:SetHotSpot(16.6666717529297, 85);
    element:SetParentElement(compositionFire_01);
    element:SetXY(37.2789154052734, 72.4786071777344);

    element:SetAngle(0);

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

    effector:SetKey(_TRACK_SX, 0.0694921875, 0.19230745529981);
    effector:SetKey(_TRACK_SY, 0.0694921875, 0.35294117647059);
    effector:SetKey(_TRACK_SX, 0.160546875, 0.27884594223197);
    effector:SetKey(_TRACK_SY, 0.160546875, 0.75294117647059);
    effector:SetKey(_TRACK_SX, 0.2516015625, 0.56730756533918);
    effector:SetKey(_TRACK_SY, 0.2516015625, 0.81764705882353);
    effector:SetKey(_TRACK_SX, 0.3426953125, 0.82692302613567);
    effector:SetKey(_TRACK_SY, 0.3426953125, 0.72941176470588);
    effector:SetKey(_TRACK_SX, 0.4337109375, 0.5961537276499);
    effector:SetKey(_TRACK_SY, 0.4337109375, 0.54705882352941);
    effector:SetKey(_TRACK_SX, 0.5248046875, 0.42307675378557);
    effector:SetKey(_TRACK_SY, 0.5248046875, 0.37058823529412);
    effector:SetKey(_TRACK_SX, 0.6158203125, 0.24999977992125);
    effector:SetKey(_TRACK_SY, 0.6158203125, 0.22352941176471);
    effector:SetKey(_TRACK_O, 0.0694921875, 0);
    effector:SetKey(_TRACK_O, 0.3426953125, 1);
    effector:SetKey(_TRACK_O, 0.6158203125, 0);

    effector:Play();

    compositionFire_01:Play();

    return compositionFire_01;
end

createCompositionFire_all = function()

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


    -- Layer Layer_1
    local element = createCompositionFire_01();
    element:SetName('Layer_1');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(370.5, 540.5);

    element:SetScaleX(0.3875);
    element:SetScaleY(0.74);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(4.4, 5.28);


    effector:Play();


    -- Layer Layer_2
    local element = createCompositionFire_01();
    element:SetName('Layer_2');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(290, 572);

    element:SetScaleX(0.35);
    element:SetScaleY(0.55);
    element:SetAngle(0);
    element:SetOpacity(1);

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


    effector:Play();


    -- Layer Layer_3
    local element = createCompositionFire_01();
    element:SetName('Layer_3');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(312, 551.5);

    element:SetScaleX(0.65);
    element:SetScaleY(0.85);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(7.56, 8.44);


    effector:Play();


    -- Layer Layer_4
    local element = createCompositionFire_01();
    element:SetName('Layer_4');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(353, 570);

    element:SetScaleX(0.65);
    element:SetScaleY(0.85);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(8.84, 9.72);


    effector:Play();


    -- Layer Layer_5
    local element = createCompositionFire_01();
    element:SetName('Layer_5');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(353, 570);

    element:SetScaleX(0.65);
    element:SetScaleY(0.85);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(2.76, 3.64);


    effector:Play();


    -- Layer Layer_6
    local element = createCompositionFire_01();
    element:SetName('Layer_6');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(312, 551.5);

    element:SetScaleX(0.65);
    element:SetScaleY(0.85);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(4, 4.88);


    effector:Play();


    -- Layer Layer_7
    local element = createCompositionFire_01();
    element:SetName('Layer_7');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(296.5, 564.5);

    element:SetScaleX(0.65);
    element:SetScaleY(0.85);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(1.48, 2.36);


    effector:Play();


    -- Layer Layer_8
    local element = createCompositionFire_01();
    element:SetName('Layer_8');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(380.5, 555);

    element:SetScaleX(0.45);
    element:SetScaleY(0.7);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(3.24, 4.12);


    effector:Play();


    -- Layer Layer_9
    local element = createCompositionFire_01();
    element:SetName('Layer_9');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(380.5, 555);

    element:SetScaleX(0.7625);
    element:SetScaleY(0.7);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(6.52, 7.4);


    effector:Play();


    -- Layer Layer_10
    local element = createCompositionFire_01();
    element:SetName('Layer_10');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(323, 550.5);

    element:SetScaleX(0.65);
    element:SetScaleY(0.79);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(6.2, 7.08);


    effector:Play();


    -- Layer Layer_11
    local element = createCompositionFire_01();
    element:SetName('Layer_11');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(380.5, 555);

    element:SetScaleX(0.7625);
    element:SetScaleY(0.7);
    element:SetAngle(0);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0.32, 1.2);


    effector:Play();


    -- Layer Layer_12
    local element = createCompositionFire_01();
    element:SetName('Layer_12');
    compositionFire_all:AddElement(element);
    element:SetHotSpot(40, 50);
    element:SetParentElement(compositionFire_all);
    element:SetXY(340.5, 566);

    element:SetScaleX(0.55);
    element:SetScaleY(0.59);
    element:SetAngle(0);
    element:SetOpacity(1);

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


    effector:Play();

    compositionFire_all:Play();

    return compositionFire_all;
end


createCompositionPilot = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Layer_rope.png');
    element:SetName('Layer_1');
    compositionPilot:AddElement(element);
    element:SetHotSpot(19, 12);
    element:SetParentElement(compositionPilot);
    element:SetXY(300.5, 360);

    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 = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Pilot_head02.png');
    element:SetName('Layer_2');
    compositionPilot:AddElement(element);
    element:SetHotSpot(16.0833333333333, 9.375);
    compositionPilot:RegisterParentInfo('Layer_2', 'Layer_3');
    element:SetXY(32, 25.5);

    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.84, 0);
    effector:SetKey(_TRACK_O, 0.92, 1);
    effector:SetKey(_TRACK_O, 1.16, 0);
    effector:SetKey(_TRACK_O, 1.96, 0);
    effector:SetKey(_TRACK_O, 2.04, 1);
    effector:SetKey(_TRACK_O, 2.28, 0);
    effector:SetKey(_TRACK_O, 3.24, 0);
    effector:SetKey(_TRACK_O, 3.32, 1);
    effector:SetKey(_TRACK_O, 3.48, 0);
    effector:SetKey(_TRACK_O, 3.56, 0);
    effector:SetKey(_TRACK_O, 3.64, 1);
    effector:SetKey(_TRACK_O, 3.88, 0);
    effector:SetKey(_TRACK_O, 5, 0);
    effector:SetKey(_TRACK_O, 5.08, 1);
    effector:SetKey(_TRACK_O, 5.32, 0);
    effector:SetKey(_TRACK_O, 6.6, 0);
    effector:SetKey(_TRACK_O, 6.68, 1);
    effector:SetKey(_TRACK_O, 6.92, 0);
    effector:SetKey(_TRACK_O, 8.08, 0);
    effector:SetKey(_TRACK_O, 8.16, 1);
    effector:SetKey(_TRACK_O, 8.4, 0);
    effector:SetKey(_TRACK_O, 9.96, 0);

    effector:Play();


    -- Layer Layer_3
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Pilot_head01.png');
    element:SetName('Layer_3');
    compositionPilot:AddElement(element);
    element:SetHotSpot(19, 40);
    compositionPilot:RegisterParentInfo('Layer_3', 'Layer_5');
    element:SetXY(42.75, 17.4932556152344);

    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, 0.12, -0.17801867795988);
    effector:SetKey(_TRACK_A, 0.28, -0.10675162823966);
    effector:SetKey(_TRACK_A, 0.48, 0.01764545039167);
    effector:SetKey(_TRACK_A, 1.96, -0.04266638512645);
    effector:SetKey(_TRACK_A, 3.24, 0.08086457569089);
    effector:SetKey(_TRACK_A, 3.48, -0.02116448561852);
    effector:SetKey(_TRACK_A, 4.36, 0.06661149713917);
    effector:SetKey(_TRACK_A, 4.72, 0.0057812023962);
    effector:SetKey(_TRACK_A, 5.04, -0.04266187021419);
    effector:SetKey(_TRACK_A, 5.4, 0.00713442208903);
    effector:SetKey(_TRACK_A, 5.72, -0.06025861195946);
    effector:SetKey(_TRACK_A, 6.04, 0.07461428053345);
    effector:SetKey(_TRACK_A, 6.28, -0.16570210854399);
    effector:SetKey(_TRACK_A, 6.52, -0.07898255900123);
    effector:SetKey(_TRACK_A, 6.76, 0.11916077494871);
    effector:SetKey(_TRACK_A, 7.04, 0.05468957586365);
    effector:SetKey(_TRACK_A, 7.48, 0.01717546554001);
    effector:SetKey(_TRACK_A, 8, 0.03911604761746);
    effector:SetKey(_TRACK_A, 8.4, 0.0021876860219);
    effector:SetKey(_TRACK_A, 8.8, 0.08549296239582);
    effector:SetKey(_TRACK_A, 9.44, -0.04055271980847);
    effector:SetKey(_TRACK_A, 9.96, 0);

    effector:Play();


    -- Layer Layer_4
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Pilot_hand02.png');
    element:SetName('Layer_4');
    compositionPilot:AddElement(element);
    element:SetHotSpot(18, 17);
    compositionPilot:RegisterParentInfo('Layer_4', 'Layer_5');
    element:SetXY(24.5, 39.7432556152344);

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

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

    effector:SetKey(_TRACK_A, 0, 0.06153545934284);
    effector:SetKey(_TRACK_A, 0.24, -0.01784028880309);
    effector:SetKey(_TRACK_A, 0.48, 0.02376209365266);
    effector:SetKey(_TRACK_A, 0.68, 0.00648531962774);
    effector:SetKey(_TRACK_A, 1.72, 0.02990528918672);
    effector:SetKey(_TRACK_A, 2.28, 0.00186365564292);
    effector:SetKey(_TRACK_A, 2.92, 0.0361544278551);
    effector:SetKey(_TRACK_A, 3.56, 0.02082754807167);
    effector:SetKey(_TRACK_A, 4.36, 0.03767043957551);
    effector:SetKey(_TRACK_A, 4.6, 0.05633601200665);
    effector:SetKey(_TRACK_A, 4.88, 0.07425407315216);
    effector:SetKey(_TRACK_A, 5.24, 0.06151815832687);
    effector:SetKey(_TRACK_A, 5.96, 0.03717934822854);
    effector:SetKey(_TRACK_A, 6.96, 0.06750872291071);
    effector:SetKey(_TRACK_A, 7.64, 0.05399676591656);
    effector:SetKey(_TRACK_A, 8.44, 0.0687912861753);
    effector:SetKey(_TRACK_A, 9.12, 0.05331288063026);
    effector:SetKey(_TRACK_A, 9.96, 0.06153545934284);

    effector:Play();


    -- Layer Layer_5
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/Pilot_body01.png');
    element:SetName('Layer_5');
    compositionPilot:AddElement(element);
    element:SetHotSpot(45, 140);
    element:SetParentElement(compositionPilot);
    element:SetScaleX(1);
    element:SetScaleY(1);
    element:SetAngle(0);
    element:SetOpacity(1);

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

    effector:SetKey(_TRACK_X, 0, 329);
    effector:SetKey(_TRACK_Y, 0, 425.756744384766);
    effector:SetKey(_TRACK_X, 0.12, 329.5);
    effector:SetKey(_TRACK_Y, 0.12, 425.256744384766);
    effector:SetKey(_TRACK_X, 0.4, 329);
    effector:SetKey(_TRACK_Y, 0.4, 425.756744384766);
    effector:SetKey(_TRACK_X, 1.52, 329);
    effector:SetKey(_TRACK_Y, 1.52, 425.756744384766);
    effector:SetKey(_TRACK_X, 1.64, 329.5);
    effector:SetKey(_TRACK_Y, 1.64, 425.256744384766);
    effector:SetKey(_TRACK_X, 1.8, 329);
    effector:SetKey(_TRACK_Y, 1.8, 425.756744384766);
    effector:SetKey(_TRACK_X, 1.92, 329);
    effector:SetKey(_TRACK_Y, 1.92, 425.756744384766);
    effector:SetKey(_TRACK_X, 2.04, 329);
    effector:SetKey(_TRACK_Y, 2.04, 425.256744384766);
    effector:SetKey(_TRACK_X, 2.32, 329);
    effector:SetKey(_TRACK_Y, 2.32, 425.756744384766);
    effector:SetKey(_TRACK_X, 3.36, 329);
    effector:SetKey(_TRACK_Y, 3.36, 425.756744384766);
    effector:SetKey(_TRACK_X, 3.48, 329.5);
    effector:SetKey(_TRACK_Y, 3.48, 425.256744384766);
    effector:SetKey(_TRACK_X, 3.76, 329);
    effector:SetKey(_TRACK_Y, 3.76, 425.756744384766);
    effector:SetKey(_TRACK_X, 6.12, 329);
    effector:SetKey(_TRACK_Y, 6.12, 425.756744384766);
    effector:SetKey(_TRACK_X, 6.24, 329.5);
    effector:SetKey(_TRACK_Y, 6.24, 425.256744384766);
    effector:SetKey(_TRACK_X, 6.4, 329);
    effector:SetKey(_TRACK_Y, 6.4, 425.756744384766);
    effector:SetKey(_TRACK_X, 6.52, 329);
    effector:SetKey(_TRACK_Y, 6.52, 425.756744384766);
    effector:SetKey(_TRACK_X, 6.64, 329);
    effector:SetKey(_TRACK_Y, 6.64, 425.256744384766);
    effector:SetKey(_TRACK_X, 6.92, 329);
    effector:SetKey(_TRACK_Y, 6.92, 425.756744384766);
    effector:SetKey(_TRACK_X, 8.24, 329);
    effector:SetKey(_TRACK_Y, 8.24, 425.756744384766);
    effector:SetKey(_TRACK_X, 8.36, 329.5);
    effector:SetKey(_TRACK_Y, 8.36, 425.256744384766);
    effector:SetKey(_TRACK_X, 8.52, 329);
    effector:SetKey(_TRACK_Y, 8.52, 425.756744384766);
    effector:SetKey(_TRACK_X, 8.64, 329);
    effector:SetKey(_TRACK_Y, 8.64, 425.756744384766);
    effector:SetKey(_TRACK_X, 8.76, 329);
    effector:SetKey(_TRACK_Y, 8.76, 425.256744384766);
    effector:SetKey(_TRACK_X, 9.04, 329);
    effector:SetKey(_TRACK_Y, 9.04, 425.756744384766);
    effector:SetKey(_TRACK_X, 9.96, 329);
    effector:SetKey(_TRACK_Y, 9.96, 425.756744384766);

    effector:Play();

    compositionPilot:Play();

    return compositionPilot;
end

createCompositionSeagull = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/sg_[0000-0009].png');
    element:SetName('Layer_1');
    compositionSeagull:AddElement(element);
    element:SetHotSpot(20, 11);
    element:SetParentElement(compositionSeagull);
    element:SetAngle(0);
    element:SetOpacity(1);

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

    effector:SetKey(_TRACK_X, 0, 134.733749389648);
    effector:SetKey(_TRACK_Y, 0, -33.4992065429688);
    effector:SetKey(_TRACK_X, 0.44, 192.733749389648);
    effector:SetKey(_TRACK_Y, 0.44, 7.50079345703125);
    effector:SetKey(_TRACK_X, 1.04, 293.733749389648);
    effector:SetKey(_TRACK_Y, 1.04, 23.5007934570313);
    effector:SetKey(_TRACK_X, 1.72, 381.733749389648);
    effector:SetKey(_TRACK_Y, 1.72, 18.5007934570313);
    effector:SetKey(_TRACK_X, 2.28, 470.733749389648);
    effector:SetKey(_TRACK_Y, 2.28, 28.5007934570313);
    effector:SetKey(_TRACK_X, 2.84, 548.733749389648);
    effector:SetKey(_TRACK_Y, 2.84, 50.5007934570313);
    effector:SetKey(_TRACK_X, 3.52, 631.733749389648);
    effector:SetKey(_TRACK_Y, 3.52, 59.5007934570313);
    effector:SetKey(_TRACK_X, 4.16, 720.733749389648);
    effector:SetKey(_TRACK_Y, 4.16, 41.5007934570313);
    effector:SetKey(_TRACK_X, 4.76, 790.733749389648);
    effector:SetKey(_TRACK_Y, 4.76, 19.5007934570313);
    effector:SetKey(_TRACK_X, 5.48, 859.733749389648);
    effector:SetKey(_TRACK_Y, 5.48, 10.5007934570313);
    effector:SetKey(_TRACK_X, 6.16, 938.733749389648);
    effector:SetKey(_TRACK_Y, 6.16, 15.5007934570313);
    effector:SetKey(_TRACK_X, 7.2, 1065.73374938965);
    effector:SetKey(_TRACK_Y, 7.2, 45.5007934570313);
    effector:SetKey(_TRACK_SX, 0, -1.4);
    effector:SetKey(_TRACK_SY, 0, 1.4);
    effector:SetKey(_TRACK_SX, 7.2, -0.8);
    effector:SetKey(_TRACK_SY, 7.2, 0.8);

    effector:Play();

    compositionSeagull:Play();

    return compositionSeagull;
end

createCompositionSparkles1 = function()

    local compositionSparkles1 = CreateCompositionSequence();
    local compositionDuration = 1.8;
    compositionSparkles1:SetDuration(compositionDuration);


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_1');
    compositionSparkles1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionSparkles1);
    element:SetScaleX(1);
    element:SetScaleY(1);

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

    effector:SetKey(_TRACK_X, 0.3603125, 365.036056518555);
    effector:SetKey(_TRACK_Y, 0.3603125, 553.893020629883);
    effector:SetKey(_TRACK_X, 0.44, 367.286056518555);
    effector:SetKey(_TRACK_Y, 0.44, 550.893020629883);
    effector:SetKey(_TRACK_X, 0.5196875, 369.036056518555);
    effector:SetKey(_TRACK_Y, 0.5196875, 545.393020629883);
    effector:SetKey(_TRACK_X, 0.5994140625, 370.286056518555);
    effector:SetKey(_TRACK_Y, 0.5994140625, 537.393020629883);
    effector:SetKey(_TRACK_X, 0.6791015625, 368.286056518555);
    effector:SetKey(_TRACK_Y, 0.6791015625, 529.643020629883);
    effector:SetKey(_TRACK_X, 0.7587890625, 362.786056518555);
    effector:SetKey(_TRACK_Y, 0.7587890625, 520.143020629883);
    effector:SetKey(_TRACK_X, 0.8384765625, 360.286056518555);
    effector:SetKey(_TRACK_Y, 0.8384765625, 509.893020629883);
    effector:SetKey(_TRACK_X, 0.918203125, 362.036056518555);
    effector:SetKey(_TRACK_Y, 0.918203125, 499.393020629883);
    effector:SetKey(_TRACK_X, 0.997890625, 365.536056518555);
    effector:SetKey(_TRACK_Y, 0.997890625, 491.893020629883);
    effector:SetKey(_TRACK_X, 1.077578125, 366.036056518555);
    effector:SetKey(_TRACK_Y, 1.077578125, 484.143020629883);
    effector:SetKey(_TRACK_X, 1.157265625, 364.536056518555);
    effector:SetKey(_TRACK_Y, 1.157265625, 476.393020629883);
    effector:SetKey(_TRACK_A, 0.358203125, 0.7853981625);
    effector:SetKey(_TRACK_A, 1.158203125, 2.0943951);
    effector:SetKey(_TRACK_O, 0.3603125, 0);
    effector:SetKey(_TRACK_O, 0.4403125, 1);
    effector:SetKey(_TRACK_O, 0.5203125, 0.1);
    effector:SetKey(_TRACK_O, 0.6403125, 1);
    effector:SetKey(_TRACK_O, 0.7203125, 0.1);
    effector:SetKey(_TRACK_O, 0.8003125, 0.6);
    effector:SetKey(_TRACK_O, 0.8803125, 0.1);
    effector:SetKey(_TRACK_O, 0.9603125, 0.4);
    effector:SetKey(_TRACK_O, 1.1603125, 0);

    effector:Play();


    -- Layer Layer_2
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_2');
    compositionSparkles1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionSparkles1);
    element:SetScaleX(1);
    element:SetScaleY(1);

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

    effector:SetKey(_TRACK_X, 0.202109375, 365.036056518555);
    effector:SetKey(_TRACK_Y, 0.202109375, 553.893020629883);
    effector:SetKey(_TRACK_X, 0.281796875, 367.286056518555);
    effector:SetKey(_TRACK_Y, 0.281796875, 550.893020629883);
    effector:SetKey(_TRACK_X, 0.361484375, 369.036056518555);
    effector:SetKey(_TRACK_Y, 0.361484375, 545.393020629883);
    effector:SetKey(_TRACK_X, 0.4412109375, 370.286056518555);
    effector:SetKey(_TRACK_Y, 0.4412109375, 537.393020629883);
    effector:SetKey(_TRACK_X, 0.5208984375, 368.286056518555);
    effector:SetKey(_TRACK_Y, 0.5208984375, 529.643020629883);
    effector:SetKey(_TRACK_X, 0.6005859375, 362.786056518555);
    effector:SetKey(_TRACK_Y, 0.6005859375, 520.143020629883);
    effector:SetKey(_TRACK_X, 0.6802734375, 360.286056518555);
    effector:SetKey(_TRACK_Y, 0.6802734375, 509.893020629883);
    effector:SetKey(_TRACK_X, 0.76, 362.036056518555);
    effector:SetKey(_TRACK_Y, 0.76, 499.393020629883);
    effector:SetKey(_TRACK_X, 0.8396875, 365.536056518555);
    effector:SetKey(_TRACK_Y, 0.8396875, 491.893020629883);
    effector:SetKey(_TRACK_X, 0.919375, 366.036056518555);
    effector:SetKey(_TRACK_Y, 0.919375, 484.143020629883);
    effector:SetKey(_TRACK_X, 0.9990625, 364.536056518555);
    effector:SetKey(_TRACK_Y, 0.9990625, 476.393020629883);
    effector:SetKey(_TRACK_A, 0.2, 0.7853981625);
    effector:SetKey(_TRACK_A, 1, 0);
    effector:SetKey(_TRACK_O, 0.202109375, 0);
    effector:SetKey(_TRACK_O, 0.282109375, 1);
    effector:SetKey(_TRACK_O, 0.362109375, 0.1);
    effector:SetKey(_TRACK_O, 0.482109375, 1);
    effector:SetKey(_TRACK_O, 0.562109375, 0.1);
    effector:SetKey(_TRACK_O, 0.642109375, 0.6);
    effector:SetKey(_TRACK_O, 0.722109375, 0.1);
    effector:SetKey(_TRACK_O, 0.802109375, 0.4);
    effector:SetKey(_TRACK_O, 1.002109375, 0);

    effector:Play();


    -- Layer Layer_3
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_3');
    compositionSparkles1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionSparkles1);
    element:SetScaleX(1);
    element:SetScaleY(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0.84, 1.64);

    effector:SetKey(_TRACK_X, 0.84, 365.036056518555);
    effector:SetKey(_TRACK_Y, 0.84, 553.893020629883);
    effector:SetKey(_TRACK_X, 0.9196875, 367.286056518555);
    effector:SetKey(_TRACK_Y, 0.9196875, 550.893020629883);
    effector:SetKey(_TRACK_X, 0.999375, 369.036056518555);
    effector:SetKey(_TRACK_Y, 0.999375, 545.393020629883);
    effector:SetKey(_TRACK_X, 1.0791015625, 370.286056518555);
    effector:SetKey(_TRACK_Y, 1.0791015625, 537.393020629883);
    effector:SetKey(_TRACK_X, 1.1587890625, 368.286056518555);
    effector:SetKey(_TRACK_Y, 1.1587890625, 529.643020629883);
    effector:SetKey(_TRACK_X, 1.2384765625, 362.786056518555);
    effector:SetKey(_TRACK_Y, 1.2384765625, 520.143020629883);
    effector:SetKey(_TRACK_X, 1.3181640625, 360.286056518555);
    effector:SetKey(_TRACK_Y, 1.3181640625, 509.893020629883);
    effector:SetKey(_TRACK_X, 1.397890625, 362.036056518555);
    effector:SetKey(_TRACK_Y, 1.397890625, 499.393020629883);
    effector:SetKey(_TRACK_X, 1.477578125, 365.536056518555);
    effector:SetKey(_TRACK_Y, 1.477578125, 491.893020629883);
    effector:SetKey(_TRACK_X, 1.557265625, 366.036056518555);
    effector:SetKey(_TRACK_Y, 1.557265625, 484.143020629883);
    effector:SetKey(_TRACK_X, 1.636953125, 364.536056518555);
    effector:SetKey(_TRACK_Y, 1.636953125, 476.393020629883);
    effector:SetKey(_TRACK_A, 0.84, 0);
    effector:SetKey(_TRACK_A, 1.64, -1.04719755);
    effector:SetKey(_TRACK_O, 0.84, 0);
    effector:SetKey(_TRACK_O, 0.92, 1);
    effector:SetKey(_TRACK_O, 1, 0.1);
    effector:SetKey(_TRACK_O, 1.12, 1);
    effector:SetKey(_TRACK_O, 1.2, 0.1);
    effector:SetKey(_TRACK_O, 1.28, 0.6);
    effector:SetKey(_TRACK_O, 1.36, 0.1);
    effector:SetKey(_TRACK_O, 1.44, 0.4);
    effector:SetKey(_TRACK_O, 1.64, 0);

    effector:Play();


    -- Layer Layer_4
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_4');
    compositionSparkles1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionSparkles1);
    element:SetScaleX(1);
    element:SetScaleY(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0.52, 1.68);

    effector:SetKey(_TRACK_X, 0.52, 365.036056518555);
    effector:SetKey(_TRACK_Y, 0.52, 553.893020629883);
    effector:SetKey(_TRACK_X, 0.5996875, 367.286056518555);
    effector:SetKey(_TRACK_Y, 0.5996875, 550.893020629883);
    effector:SetKey(_TRACK_X, 0.679375, 369.036056518555);
    effector:SetKey(_TRACK_Y, 0.679375, 545.393020629883);
    effector:SetKey(_TRACK_X, 0.7591015625, 370.286056518555);
    effector:SetKey(_TRACK_Y, 0.7591015625, 537.393020629883);
    effector:SetKey(_TRACK_X, 0.8387890625, 368.286056518555);
    effector:SetKey(_TRACK_Y, 0.8387890625, 529.643020629883);
    effector:SetKey(_TRACK_X, 0.9184765625, 362.786056518555);
    effector:SetKey(_TRACK_Y, 0.9184765625, 520.143020629883);
    effector:SetKey(_TRACK_X, 0.9981640625, 360.286056518555);
    effector:SetKey(_TRACK_Y, 0.9981640625, 509.893020629883);
    effector:SetKey(_TRACK_X, 1.077890625, 362.036056518555);
    effector:SetKey(_TRACK_Y, 1.077890625, 499.393020629883);
    effector:SetKey(_TRACK_X, 1.157578125, 365.536056518555);
    effector:SetKey(_TRACK_Y, 1.157578125, 491.893020629883);
    effector:SetKey(_TRACK_X, 1.237265625, 366.036056518555);
    effector:SetKey(_TRACK_Y, 1.237265625, 484.143020629883);
    effector:SetKey(_TRACK_X, 1.316953125, 364.536056518555);
    effector:SetKey(_TRACK_Y, 1.316953125, 476.393020629883);
    effector:SetKey(_TRACK_A, 0.52, 0);
    effector:SetKey(_TRACK_A, 1.316953125, 1.04719755);
    effector:SetKey(_TRACK_O, 0.52, 0);
    effector:SetKey(_TRACK_O, 0.6, 1);
    effector:SetKey(_TRACK_O, 0.68, 0.1);
    effector:SetKey(_TRACK_O, 0.8, 1);
    effector:SetKey(_TRACK_O, 0.88, 0.1);
    effector:SetKey(_TRACK_O, 0.96, 0.6);
    effector:SetKey(_TRACK_O, 1.04, 0.1);
    effector:SetKey(_TRACK_O, 1.12, 0.4);
    effector:SetKey(_TRACK_O, 1.32, 0);

    effector:Play();


    -- Layer Layer_5
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_5');
    compositionSparkles1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionSparkles1);
    element:SetScaleX(1);
    element:SetScaleY(1);

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

    effector:SetKey(_TRACK_X, 0, 365.036056518555);
    effector:SetKey(_TRACK_Y, 0, 553.893020629883);
    effector:SetKey(_TRACK_X, 0.0796875, 367.286056518555);
    effector:SetKey(_TRACK_Y, 0.0796875, 550.893020629883);
    effector:SetKey(_TRACK_X, 0.159375, 369.036056518555);
    effector:SetKey(_TRACK_Y, 0.159375, 545.393020629883);
    effector:SetKey(_TRACK_X, 0.2391015625, 370.286056518555);
    effector:SetKey(_TRACK_Y, 0.2391015625, 537.393020629883);
    effector:SetKey(_TRACK_X, 0.3187890625, 368.286056518555);
    effector:SetKey(_TRACK_Y, 0.3187890625, 529.643020629883);
    effector:SetKey(_TRACK_X, 0.3984765625, 362.786056518555);
    effector:SetKey(_TRACK_Y, 0.3984765625, 520.143020629883);
    effector:SetKey(_TRACK_X, 0.4781640625, 360.286056518555);
    effector:SetKey(_TRACK_Y, 0.4781640625, 509.893020629883);
    effector:SetKey(_TRACK_X, 0.557890625, 362.036056518555);
    effector:SetKey(_TRACK_Y, 0.557890625, 499.393020629883);
    effector:SetKey(_TRACK_X, 0.637578125, 365.536056518555);
    effector:SetKey(_TRACK_Y, 0.637578125, 491.893020629883);
    effector:SetKey(_TRACK_X, 0.717265625, 366.036056518555);
    effector:SetKey(_TRACK_Y, 0.717265625, 484.143020629883);
    effector:SetKey(_TRACK_X, 0.796953125, 364.536056518555);
    effector:SetKey(_TRACK_Y, 0.796953125, 476.393020629883);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 0.796953125, 1.04719755);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.08, 1);
    effector:SetKey(_TRACK_O, 0.16, 0.1);
    effector:SetKey(_TRACK_O, 0.28, 1);
    effector:SetKey(_TRACK_O, 0.36, 0.1);
    effector:SetKey(_TRACK_O, 0.44, 0.6);
    effector:SetKey(_TRACK_O, 0.52, 0.1);
    effector:SetKey(_TRACK_O, 0.6, 0.4);
    effector:SetKey(_TRACK_O, 0.8, 0);

    effector:Play();

    compositionSparkles1:Play();

    return compositionSparkles1;
end

createCompositionSparkles_all = function()

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


    -- Layer Layer_1
    local element = createCompositionSparkles1();
    element:SetName('Layer_1');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(500, 402);

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

    effector = element:GetEffector();
    effector:SetLifeTime(5.76, 7.56);


    effector:Play();


    -- Layer Layer_2
    local element = createCompositionSparkles1();
    element:SetName('Layer_2');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(464, 386);

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

    effector = element:GetEffector();
    effector:SetLifeTime(3.68, 5.48);


    effector:Play();


    -- Layer Layer_3
    local element = createCompositionSparkles1();
    element:SetName('Layer_3');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(457, 398);

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

    effector = element:GetEffector();
    effector:SetLifeTime(8.04, 9.84);


    effector:Play();


    -- Layer Layer_4
    local element = createCompositionSparkles1();
    element:SetName('Layer_4');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(457, 398);

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

    effector = element:GetEffector();
    effector:SetLifeTime(0.64, 2.44);


    effector:Play();


    -- Layer Layer_5
    local element = createCompositionSparkles1();
    element:SetName('Layer_5');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(498, 406);

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

    effector = element:GetEffector();
    effector:SetLifeTime(6.96, 8.76);


    effector:Play();


    -- Layer Layer_6
    local element = createCompositionSparkles1();
    element:SetName('Layer_6');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(491, 385);

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

    effector = element:GetEffector();
    effector:SetLifeTime(1.8, 3.6);


    effector:Play();


    -- Layer Layer_7
    local element = createCompositionSparkles1();
    element:SetName('Layer_7');
    compositionSparkles_all:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionSparkles_all);
    element:SetXY(512, 384);

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

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


    effector:Play();

    compositionSparkles_all:Play();

    return compositionSparkles_all;
end

createCompositionWave_01 = function()

    local compositionWave_01 = CreateCompositionSequence();
    local compositionDuration = 2;
    compositionWave_01:SetDuration(compositionDuration);


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/EF_waves.png');
    element:SetName('Layer_1');
    compositionWave_01:AddElement(element);
    element:SetHotSpot(60, 3.5);
    element:SetParentElement(compositionWave_01);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_X, 0, 127.136688232422);
    effector:SetKey(_TRACK_Y, 0, 36.8320159912109);
    effector:SetKey(_TRACK_X, 0.216328125, 127.261688232422);
    effector:SetKey(_TRACK_Y, 0.216328125, 38.2070159912109);
    effector:SetKey(_TRACK_X, 0.4326953125, 127.511688232422);
    effector:SetKey(_TRACK_Y, 0.4326953125, 40.0195159912109);
    effector:SetKey(_TRACK_X, 0.6490625, 128.074188232422);
    effector:SetKey(_TRACK_Y, 0.6490625, 42.3945159912109);
    effector:SetKey(_TRACK_X, 0.8654296875, 128.886688232422);
    effector:SetKey(_TRACK_Y, 0.8654296875, 43.5195159912109);
    effector:SetKey(_TRACK_X, 1.0817578125, 129.449188232422);
    effector:SetKey(_TRACK_Y, 1.0817578125, 44.1445159912109);
    effector:SetKey(_TRACK_X, 1.2980859375, 130.074188232422);
    effector:SetKey(_TRACK_Y, 1.2980859375, 43.6445159912109);
    effector:SetKey(_TRACK_X, 1.514453125, 130.699188232422);
    effector:SetKey(_TRACK_Y, 1.514453125, 42.7070159912109);
    effector:SetKey(_TRACK_X, 1.7308203125, 131.261688232422);
    effector:SetKey(_TRACK_Y, 1.7308203125, 41.0820159912109);
    effector:SetKey(_TRACK_X, 1.997578125, 131.574188232422);
    effector:SetKey(_TRACK_Y, 1.997578125, 39.2695159912109);
    effector:SetKey(_TRACK_SX, 0, 1.55);
    effector:SetKey(_TRACK_SY, 0, 1);
    effector:SetKey(_TRACK_SX, 0.7990234375, 1.64583333333333);
    effector:SetKey(_TRACK_SY, 0.7990234375, 1.45454545454546);
    effector:SetKey(_TRACK_SX, 1.997578125, 1.76666666666667);
    effector:SetKey(_TRACK_SY, 1.997578125, 1.22727272727273);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.7990234375, 1);
    effector:SetKey(_TRACK_O, 1.997578125, 0);

    effector:Play();

    compositionWave_01:Play();

    return compositionWave_01;
end

createCompositionWaves_all = function()

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


    -- Layer Layer_1
    local element = createCompositionWave_01();
    element:SetName('Layer_1');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(624.223846435547, 326.203643798828);

    element:SetScaleX(1.04554294230425);
    element:SetScaleY(0.6901158084289);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(7.6, 9.6);


    effector:Play();


    -- Layer Layer_2
    local element = createCompositionWave_01();
    element:SetName('Layer_2');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(624.223846435547, 326.203643798828);

    element:SetScaleX(1.04554294230425);
    element:SetScaleY(0.6901158084289);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(5.16, 7.16);


    effector:Play();


    -- Layer Layer_3
    local element = createCompositionWave_01();
    element:SetName('Layer_3');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(624.223846435547, 326.203643798828);

    element:SetScaleX(1.04554294230425);
    element:SetScaleY(0.6901158084289);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(2.8, 4.8);


    effector:Play();


    -- Layer Layer_4
    local element = createCompositionWave_01();
    element:SetName('Layer_4');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(624.223846435547, 326.203643798828);

    element:SetScaleX(1.04554294230425);
    element:SetScaleY(0.6901158084289);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0.24, 2.24);


    effector:Play();


    -- Layer Layer_5
    local element = createCompositionWave_01();
    element:SetName('Layer_5');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(604.75, 361.5);

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

    effector = element:GetEffector();
    effector:SetLifeTime(5.84, 7.84);


    effector:Play();


    -- Layer Layer_6
    local element = createCompositionWave_01();
    element:SetName('Layer_6');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(939.331619262695, 373.736923217773);

    element:SetScaleX(0.44880732099689);
    element:SetScaleY(0.70120407944398);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(7.96, 9.96);


    effector:Play();


    -- Layer Layer_7
    local element = createCompositionWave_01();
    element:SetName('Layer_7');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(546.920364379883, 305.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(7.16, 9.16);


    effector:Play();


    -- Layer Layer_8
    local element = createCompositionWave_01();
    element:SetName('Layer_8');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(665.420364379883, 303.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

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


    effector:Play();


    -- Layer Layer_9
    local element = createCompositionWave_01();
    element:SetName('Layer_9');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(546.920364379883, 305.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(4.96, 6.96);


    effector:Play();


    -- Layer Layer_10
    local element = createCompositionWave_01();
    element:SetName('Layer_10');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(665.420364379883, 303.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(5.8, 7.8);


    effector:Play();


    -- Layer Layer_11
    local element = createCompositionWave_01();
    element:SetName('Layer_11');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(546.920364379883, 305.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(2.56, 4.56);


    effector:Play();


    -- Layer Layer_12
    local element = createCompositionWave_01();
    element:SetName('Layer_12');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(665.420364379883, 303.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(3.4, 5.4);


    effector:Play();


    -- Layer Layer_13
    local element = createCompositionWave_01();
    element:SetName('Layer_13');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(665.420364379883, 303.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(1.16, 3.16);


    effector:Play();


    -- Layer Layer_14
    local element = createCompositionWave_01();
    element:SetName('Layer_14');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(546.920364379883, 305.295562744141);

    element:SetScaleX(0.7029543634354);
    element:SetScaleY(0.6912913209797);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0.32, 2.32);


    effector:Play();


    -- Layer Layer_15
    local element = createCompositionWave_01();
    element:SetName('Layer_15');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(939.331619262695, 373.736923217773);

    element:SetScaleX(0.44880732099689);
    element:SetScaleY(0.70120407944398);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(5.56, 7.56);


    effector:Play();


    -- Layer Layer_16
    local element = createCompositionWave_01();
    element:SetName('Layer_16');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(939.331619262695, 373.736923217773);

    element:SetScaleX(0.44880732099689);
    element:SetScaleY(0.70120407944398);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(2.88, 4.88);


    effector:Play();


    -- Layer Layer_17
    local element = createCompositionWave_01();
    element:SetName('Layer_17');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(939.331619262695, 373.736923217773);

    element:SetScaleX(0.44880732099689);
    element:SetScaleY(0.70120407944398);
    element:SetAngle(0.06135588577941);
    element:SetOpacity(1);

    effector = element:GetEffector();
    effector:SetLifeTime(0.4, 2.4);


    effector:Play();


    -- Layer Layer_18
    local element = createCompositionWave_01();
    element:SetName('Layer_18');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(604.75, 361.5);

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

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


    effector:Play();


    -- Layer Layer_19
    local element = createCompositionWave_01();
    element:SetName('Layer_19');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(604.75, 361.5);

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

    effector = element:GetEffector();
    effector:SetLifeTime(2.04, 4.04);


    effector:Play();


    -- Layer Layer_20
    local element = createCompositionWave_01();
    element:SetName('Layer_20');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(662.072509765625, 369.802688598633);

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

    effector = element:GetEffector();
    effector:SetLifeTime(7.44, 9.44);


    effector:Play();


    -- Layer Layer_21
    local element = createCompositionWave_01();
    element:SetName('Layer_21');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(572.75, 356);

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

    effector = element:GetEffector();
    effector:SetLifeTime(6.96, 8.96);


    effector:Play();


    -- Layer Layer_22
    local element = createCompositionWave_01();
    element:SetName('Layer_22');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(663.289627075195, 360.065765380859);

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

    effector = element:GetEffector();
    effector:SetLifeTime(3.88, 5.88);


    effector:Play();


    -- Layer Layer_23
    local element = createCompositionWave_01();
    element:SetName('Layer_23');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(572.75, 356);

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

    effector = element:GetEffector();
    effector:SetLifeTime(3.24, 5.24);


    effector:Play();


    -- Layer Layer_24
    local element = createCompositionWave_01();
    element:SetName('Layer_24');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(664.506729125977, 367.368469238281);

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

    effector = element:GetEffector();
    effector:SetLifeTime(0.48, 2.48);


    effector:Play();


    -- Layer Layer_25
    local element = createCompositionWave_01();
    element:SetName('Layer_25');
    compositionWaves_all:AddElement(element);
    element:SetHotSpot(128, 50);
    element:SetParentElement(compositionWaves_all);
    element:SetXY(572.75, 356);

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

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


    effector:Play();

    compositionWaves_all:Play();

    return compositionWaves_all;
end

createCompositionWood = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/25_NearTheCopter/Animations/Env/drova_001.png');
    element:SetName('Layer_1');
    compositionWood:AddElement(element);
    element:SetHotSpot(122, 52);
    element:SetParentElement(compositionWood);
    element:SetXY(326, 554);

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

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


    effector:Play();

    compositionWood:Play();

    return compositionWood;
end

