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

--// 1.	rename:					" -> '
--// 2. comment root compositions routine:
--//	"createComposition13_TribeLeaderHut_01 = function()"
--// 3. add auxiliaru routines for managing animations: 
--		auxPlayTribeLeaderHutAnimation(), 
--		auxGetTribeLeaderHutAnimation(), 
--		auxCreateTribeLeaderHutAnimations()
--// 4. replace CreateCompositionElement() with auxCreateCompositionElement() for some corrections ...

------------------------------------------------------------------------------
--
function auxPlayTribeLeaderHutAnimation(compositionName)
    local composition = auxGetTribeLeaderHutAnimation(compositionName);
    composition:SetVisible(true);
    composition:Play();
end

------------------------------------------------------------------------------
--
function auxHideTribeLeaderHutAnimation(compositionName)
    local composition = auxGetTribeLeaderHutAnimation(compositionName);
    composition:Stop();
    composition:SetVisible(false);
end

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

    return tribeLeaderHutCompositions[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/13_TribeLeaderHut/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 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_Dust_01.jpg' or
		texName == 'Env/EF_Light02.jpg' or
		texName == 'Env/EF_sparkles.jpg' or
		texName == 'Env/Fire_glow01.jpg') then

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

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

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

	--//
    CreateAndRegisterComposition(parent, createCompositionFly1,			'Fly1',			0,0,108.4, 512,384, 10, false);
    CreateAndRegisterComposition(parent, createCompositionEnvTop,		'EnvTop',		0,0,108.3, 512,384, 10, true);
    CreateAndRegisterComposition(parent, createCompositionTorchesFire,	'TorchesFire',	0,0,108.2, 512,384, 0.96, true);
    CreateAndRegisterComposition(parent, createCompositionFly2,			'Fly2',			0,0,108.1, 512,384, 10, false);
end

------------------------------------------------------------------------------
--createComposition13_TribeLeaderHut_01 = function()
--
--    local composition13_TribeLeaderHut_01 = CreateCompositionSequence();
--    local compositionDuration = 10;
--    composition13_TribeLeaderHut_01:SetDuration(compositionDuration);
--
--
--    -- Layer Layer_1
--    local element = createCompositionFly1();
--    element:SetName('Layer_1');
--    composition13_TribeLeaderHut_01:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(composition13_TribeLeaderHut_01);
--    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 = createCompositionEnvTop();
--    element:SetName('Layer_2');
--    composition13_TribeLeaderHut_01:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(composition13_TribeLeaderHut_01);
--    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 = createCompositionTorchesFire();
--    element:SetName('Layer_3');
--    composition13_TribeLeaderHut_01:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(composition13_TribeLeaderHut_01);
--    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 = createCompositionFly2();
--    element:SetName('Layer_4');
--    composition13_TribeLeaderHut_01:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(composition13_TribeLeaderHut_01);
--    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 = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/13_TribeLeaderHut_01.jpg');
--    element:SetName('Layer_5');
--    composition13_TribeLeaderHut_01:AddElement(element);
--    element:SetHotSpot(512, 384);
--    element:SetParentElement(composition13_TribeLeaderHut_01);
--    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();
--
--    composition13_TribeLeaderHut_01:Play();
--
--    return composition13_TribeLeaderHut_01;
--end

createCompositionDust1 = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_Dust_01.jpg');
    element:SetName('Layer_1');
    compositionDust1:AddElement(element);
    element:SetHotSpot(130.5, 131);
    element:SetParentElement(compositionDust1);

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

    effector:SetKey(_TRACK_X, 0, 550.054061889648);
    effector:SetKey(_TRACK_Y, 0, 332.108108520508);
    effector:SetKey(_TRACK_X, 9.96, 550.054061889648);
    effector:SetKey(_TRACK_Y, 9.96, 262.054061889648);
    effector:SetKey(_TRACK_SX, 0, 0.8);
    effector:SetKey(_TRACK_SY, 0, 0.8);
    effector:SetKey(_TRACK_SX, 9.96, 1);
    effector:SetKey(_TRACK_SY, 9.96, 1);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 9.96, 0.2617993875);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.76, 0.2);
    effector:SetKey(_TRACK_O, 1.44, 1);
    effector:SetKey(_TRACK_O, 2, 0.2);
    effector:SetKey(_TRACK_O, 2.68, 0.6);
    effector:SetKey(_TRACK_O, 3.32, 0.1);
    effector:SetKey(_TRACK_O, 3.96, 0.8);
    effector:SetKey(_TRACK_O, 4.52, 0.2);
    effector:SetKey(_TRACK_O, 5.32, 0.8);
    effector:SetKey(_TRACK_O, 5.76, 0.2);
    effector:SetKey(_TRACK_O, 6.8, 0.8);
    effector:SetKey(_TRACK_O, 7.32, 0.2);
    effector:SetKey(_TRACK_O, 8.12, 0.6);
    effector:SetKey(_TRACK_O, 8.92, 0.2);
    effector:SetKey(_TRACK_O, 9.96, 0);

    effector:Play();


    -- Layer Layer_2
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_Dust_01.jpg');
    element:SetName('Layer_2');
    compositionDust1:AddElement(element);
    element:SetHotSpot(130.5, 131);
    element:SetParentElement(compositionDust1);

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

    effector:SetKey(_TRACK_X, 0, 546.162170410156);
    effector:SetKey(_TRACK_Y, 0, 483.891891479492);
    effector:SetKey(_TRACK_X, 9.96, 546.162170410156);
    effector:SetKey(_TRACK_Y, 9.96, 413.837844848633);
    effector:SetKey(_TRACK_SX, 0, 1.2);
    effector:SetKey(_TRACK_SY, 0, 1.2);
    effector:SetKey(_TRACK_SX, 9.96, 1);
    effector:SetKey(_TRACK_SY, 9.96, 1);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 9.96, 0.2617993875);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.76, 0.8);
    effector:SetKey(_TRACK_O, 1.76, 0.2);
    effector:SetKey(_TRACK_O, 2.44, 1);
    effector:SetKey(_TRACK_O, 3, 0.2);
    effector:SetKey(_TRACK_O, 3.68, 0.6);
    effector:SetKey(_TRACK_O, 4.32, 0.1);
    effector:SetKey(_TRACK_O, 4.96, 0.8);
    effector:SetKey(_TRACK_O, 5.52, 0.2);
    effector:SetKey(_TRACK_O, 6.32, 0.8);
    effector:SetKey(_TRACK_O, 6.76, 0.2);
    effector:SetKey(_TRACK_O, 7.8, 0.8);
    effector:SetKey(_TRACK_O, 8.32, 0.2);
    effector:SetKey(_TRACK_O, 9.12, 0.6);
    effector:SetKey(_TRACK_O, 9.96, 0);

    effector:Play();

    compositionDust1:Play();

    return compositionDust1;
end

createCompositionEnvTop = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_Light02.jpg');
    element:SetName('Layer_1');
    compositionEnvTop:AddElement(element);
    element:SetHotSpot(64, 113);
    element:SetParentElement(compositionEnvTop);
    element:SetXY(234.810836791992, 368.432418823242);

    element:SetScaleX(1.35122665901597);
    element:SetScaleY(2.65352170348657);
    element:SetAngle(-0.15830769449997);

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

    effector:SetKey(_TRACK_O, 0, 0.2);
    effector:SetKey(_TRACK_O, 0.72625, 0.23932267115818);
    effector:SetKey(_TRACK_O, 1.48625, 0.5170957119042);
    effector:SetKey(_TRACK_O, 2.80625, 0.18628159013841);
    effector:SetKey(_TRACK_O, 3.80625, 0.57188097546431);
    effector:SetKey(_TRACK_O, 4.64625, 0.23932266514247);
    effector:SetKey(_TRACK_O, 5.44625, 0.4639623376012);
    effector:SetKey(_TRACK_O, 6.72625, 0.2648584837308);
    effector:SetKey(_TRACK_O, 7.44625, 0.41459069234971);
    effector:SetKey(_TRACK_O, 8.4, 0.2648584837308);
    effector:SetKey(_TRACK_O, 9.28, 0.34147185400552);
    effector:SetKey(_TRACK_O, 9.96, 0.2);

    effector:Play();


    -- Layer Layer_2
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_Light02.jpg');
    element:SetName('Layer_2');
    compositionEnvTop:AddElement(element);
    element:SetHotSpot(64, 113);
    element:SetParentElement(compositionEnvTop);
    element:SetXY(828.972991943359, 382.702697753906);

    element:SetScaleX(1.35122665901597);
    element:SetScaleY(2.65352170348657);
    element:SetAngle(0.08287580930909);

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

    effector:SetKey(_TRACK_O, 0, 0.2);
    effector:SetKey(_TRACK_O, 1.32, 0.37526804075044);
    effector:SetKey(_TRACK_O, 2.44, 0.2000000085667);
    effector:SetKey(_TRACK_O, 3.2, 0.47777304931272);
    effector:SetKey(_TRACK_O, 4.52, 0.14695892754693);
    effector:SetKey(_TRACK_O, 5.52, 0.53255831287283);
    effector:SetKey(_TRACK_O, 6.36, 0.20000000255099);
    effector:SetKey(_TRACK_O, 7.16, 0.42463967500972);
    effector:SetKey(_TRACK_O, 8.44, 0.22553582113932);
    effector:SetKey(_TRACK_O, 9.16, 0.37526802975823);
    effector:SetKey(_TRACK_O, 9.96, 0.2);

    effector:Play();


    -- Layer Layer_3
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_Light02.jpg');
    element:SetName('Layer_3');
    compositionEnvTop:AddElement(element);
    element:SetHotSpot(64, 113);
    element:SetParentElement(compositionEnvTop);
    element:SetXY(538.378387451172, 347.675674438477);

    element:SetScaleX(2.41891891891892);
    element:SetScaleY(3.04353025591964);
    element:SetAngle(0);

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

    effector:SetKey(_TRACK_O, 0, 0.2);
    effector:SetKey(_TRACK_O, 0.84, 0.6);
    effector:SetKey(_TRACK_O, 1.92, 0.2);
    effector:SetKey(_TRACK_O, 3.16, 0.51949899997774);
    effector:SetKey(_TRACK_O, 4.2, 0.1);
    effector:SetKey(_TRACK_O, 5.16, 0.41341683793819);
    effector:SetKey(_TRACK_O, 6.12, 0.14695892754693);
    effector:SetKey(_TRACK_O, 6.92, 0.62626372452621);
    effector:SetKey(_TRACK_O, 7.96, 0.27714680071153);
    effector:SetKey(_TRACK_O, 8.72, 0.47777304931272);
    effector:SetKey(_TRACK_O, 9.96, 0.2);

    effector:Play();


    -- Layer Layer_4
    local element = createCompositionDust1();
    element:SetName('Layer_4');
    compositionEnvTop:AddElement(element);
    element:SetHotSpot(512, 384);
    element:SetParentElement(compositionEnvTop);
    element:SetXY(875.243240356445, 526.702713012695);

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

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


    effector:Play();


    -- Layer Layer_5
    local element = createCompositionDust1();
    element:SetName('Layer_5');
    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

createCompositionFire1 = function()

    local compositionFire1 = CreateCompositionSequence();
    local compositionDuration = 0.96;
    compositionFire1:SetDuration(compositionDuration);


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/Fire_glow01.jpg');
    element:SetName('Layer_1');
    compositionFire1:AddElement(element);
    element:SetHotSpot(48, 48);
    element:SetParentElement(compositionFire1);
    element:SetXY(49, 141.5);


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

    effector:SetKey(_TRACK_SX, 0, 1);
    effector:SetKey(_TRACK_SY, 0, 1);
    effector:SetKey(_TRACK_SX, 0.32, 1.2);
    effector:SetKey(_TRACK_SY, 0.32, 1.2);
    effector:SetKey(_TRACK_SX, 0.96, 1);
    effector:SetKey(_TRACK_SY, 0.96, 1);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 0.32, 0.2617993875);
    effector:SetKey(_TRACK_A, 0.6, -0.2617993875);
    effector:SetKey(_TRACK_A, 0.96, 0);
    effector:SetKey(_TRACK_O, 0, 0.2);
    effector:SetKey(_TRACK_O, 0.16, 0.3);
    effector:SetKey(_TRACK_O, 0.32, 0.15);
    effector:SetKey(_TRACK_O, 0.44, 0.25);
    effector:SetKey(_TRACK_O, 0.56, 0.15);
    effector:SetKey(_TRACK_O, 0.76, 0.3);
    effector:SetKey(_TRACK_O, 0.96, 0.2);

    effector:Play();


    -- Layer Layer_2
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_2');
    compositionFire1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionFire1);
    element:SetAngle(-3.14159265);

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

    effector:SetKey(_TRACK_X, 0, 49.75);
    effector:SetKey(_TRACK_Y, 0, 71.25);
    effector:SetKey(_TRACK_X, 0.16, 47.25);
    effector:SetKey(_TRACK_Y, 0.16, 65.25);
    effector:SetKey(_TRACK_X, 0.28, 43.75);
    effector:SetKey(_TRACK_Y, 0.28, 49);
    effector:SetKey(_TRACK_X, 0.52, 49.25);
    effector:SetKey(_TRACK_Y, 0.52, 156);
    effector:SetKey(_TRACK_X, 0.56, 47);
    effector:SetKey(_TRACK_Y, 0.56, 140);
    effector:SetKey(_TRACK_X, 0.68, 52);
    effector:SetKey(_TRACK_Y, 0.68, 112.5);
    effector:SetKey(_TRACK_X, 0.8, 49.75);
    effector:SetKey(_TRACK_Y, 0.8, 87.25);
    effector:SetKey(_TRACK_SX, 0.52, 0.5);
    effector:SetKey(_TRACK_SY, 0.52, 0.5);
    effector:SetKey(_TRACK_SX, 0.64, 0.9);
    effector:SetKey(_TRACK_SY, 0.64, 0.9);
    effector:SetKey(_TRACK_O, 0, 0.1);
    effector:SetKey(_TRACK_O, 0.12, 0.8);
    effector:SetKey(_TRACK_O, 0.2, 0.1);
    effector:SetKey(_TRACK_O, 0.28, 1);
    effector:SetKey(_TRACK_O, 0.52, 0);
    effector:SetKey(_TRACK_O, 0.56, 1);
    effector:SetKey(_TRACK_O, 0.64, 0.2);
    effector:SetKey(_TRACK_O, 0.72, 1);
    effector:SetKey(_TRACK_O, 0.8, 0.1);

    effector:Play();


    -- Layer Layer_3
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_sparkles.jpg');
    element:SetName('Layer_3');
    compositionFire1:AddElement(element);
    element:SetHotSpot(25, 25);
    element:SetParentElement(compositionFire1);

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

    effector:SetKey(_TRACK_X, 0, 49.25);
    effector:SetKey(_TRACK_Y, 0, 140);
    effector:SetKey(_TRACK_X, 0.12, 54.25);
    effector:SetKey(_TRACK_Y, 0.12, 139.25);
    effector:SetKey(_TRACK_X, 0.24, 45.25);
    effector:SetKey(_TRACK_Y, 0.24, 117.5);
    effector:SetKey(_TRACK_X, 0.36, 48.5);
    effector:SetKey(_TRACK_Y, 0.36, 104.25);
    effector:SetKey(_TRACK_X, 0.48, 45.75);
    effector:SetKey(_TRACK_Y, 0.48, 88);
    effector:SetKey(_TRACK_X, 0.6, 49.25);
    effector:SetKey(_TRACK_Y, 0.6, 67.5);
    effector:SetKey(_TRACK_X, 0.72, 51.25);
    effector:SetKey(_TRACK_Y, 0.72, 46.5);
    effector:SetKey(_TRACK_SX, 0, 0.5);
    effector:SetKey(_TRACK_SY, 0, 0.5);
    effector:SetKey(_TRACK_SX, 0.2, 0.9);
    effector:SetKey(_TRACK_SY, 0.2, 0.9);
    effector:SetKey(_TRACK_SX, 0.72, 0.6);
    effector:SetKey(_TRACK_SY, 0.72, 0.6);
    effector:SetKey(_TRACK_A, 0, 0);
    effector:SetKey(_TRACK_A, 0.72, 3.14159265);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.12, 1);
    effector:SetKey(_TRACK_O, 0.2, 0.2);
    effector:SetKey(_TRACK_O, 0.28, 1);
    effector:SetKey(_TRACK_O, 0.36, 0.1);
    effector:SetKey(_TRACK_O, 0.44, 0.8);
    effector:SetKey(_TRACK_O, 0.52, 0.1);
    effector:SetKey(_TRACK_O, 0.6, 1);
    effector:SetKey(_TRACK_O, 0.72, 0);

    effector:Play();


    -- Layer Layer_4
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_burn03.jpg');
    element:SetName('Layer_4');
    compositionFire1:AddElement(element);
    element:SetHotSpot(16.8333282470703, 82.3333282470703);
    element:SetParentElement(compositionFire1);
    element:SetXY(50.0405426025391, 149.418914794922);

    element:SetAngle(0);

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

    effector:SetKey(_TRACK_SX, 0, -0.66860014790886);
    effector:SetKey(_TRACK_SY, 0, 0.76692309060181);
    effector:SetKey(_TRACK_SX, 0.12, -0.48288586219458);
    effector:SetKey(_TRACK_SY, 0.12, 0.86730770009509);
    effector:SetKey(_TRACK_SX, 0.2, -1.11145729076601);
    effector:SetKey(_TRACK_SY, 0.2, 0.31923080918351);
    effector:SetKey(_TRACK_SX, 0.24, -0.60056976705511);
    effector:SetKey(_TRACK_SY, 0.24, 0.43866640118351);
    effector:SetKey(_TRACK_SX, 0.32, -0.5399594833962);
    effector:SetKey(_TRACK_SY, 0.32, 0.57971156312728);
    effector:SetKey(_TRACK_SX, 0.36, -0.85431443362315);
    effector:SetKey(_TRACK_SY, 0.36, 0.66653848110853);
    effector:SetKey(_TRACK_SX, 0.48, -0.66860014790886);
    effector:SetKey(_TRACK_SY, 0.48, 0.76692309060181);
    effector:SetKey(_TRACK_SX, 0.6, -0.48288586219458);
    effector:SetKey(_TRACK_SY, 0.6, 0.86730770009509);
    effector:SetKey(_TRACK_SX, 0.68, -1.11145729076601);
    effector:SetKey(_TRACK_SY, 0.68, 0.31923080918351);
    effector:SetKey(_TRACK_SX, 0.8, -0.5399594833962);
    effector:SetKey(_TRACK_SY, 0.8, 0.57971156312728);
    effector:SetKey(_TRACK_SX, 0.84, -0.79606202369812);
    effector:SetKey(_TRACK_SY, 0.84, 0.63392980708979);
    effector:SetKey(_TRACK_SX, 0.88, -0.44289521216824);
    effector:SetKey(_TRACK_SY, 0.88, 0.70000001760629);
    effector:SetKey(_TRACK_SX, 0.96, -0.66860014790886);
    effector:SetKey(_TRACK_SY, 0.96, 0.76692309060181);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 0.12, 0);
    effector:SetKey(_TRACK_O, 0.2, 0);
    effector:SetKey(_TRACK_O, 0.32, 1);
    effector:SetKey(_TRACK_O, 0.48, 1);
    effector:SetKey(_TRACK_O, 0.6, 0);
    effector:SetKey(_TRACK_O, 0.68, 0);
    effector:SetKey(_TRACK_O, 0.8, 1);
    effector:SetKey(_TRACK_O, 0.96, 1);

    effector:Play();


    -- Layer Layer_5
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_burn02.jpg');
    element:SetName('Layer_5');
    compositionFire1:AddElement(element);
    element:SetHotSpot(15.9285736083984, 68.3571472167969);
    element:SetParentElement(compositionFire1);
    element:SetXY(49.4459533691406, 152.608108520508);

    element:SetAngle(0);

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

    effector:SetKey(_TRACK_SX, 0, 0.40425325785653);
    effector:SetKey(_TRACK_SY, 0, 0.37774700189872);
    effector:SetKey(_TRACK_SX, 0.08, 0.36032019785347);
    effector:SetKey(_TRACK_SY, 0.08, 0.47283581506094);
    effector:SetKey(_TRACK_SX, 0.24, 0.60281870166198);
    effector:SetKey(_TRACK_SY, 0.24, 0.66653848110853);
    effector:SetKey(_TRACK_SX, 0.32, 0.56757615073977);
    effector:SetKey(_TRACK_SY, 0.32, 1.15770395128932);
    effector:SetKey(_TRACK_SX, 0.36, 0.97424727309054);
    effector:SetKey(_TRACK_SY, 0.36, 0.86730770009509);
    effector:SetKey(_TRACK_SX, 0.44, 0.41776184638516);
    effector:SetKey(_TRACK_SY, 0.44, 0.64150110028712);
    effector:SetKey(_TRACK_SX, 0.56, 0.34567584451912);
    effector:SetKey(_TRACK_SY, 0.56, 0.31923080918351);
    effector:SetKey(_TRACK_SX, 0.6, 0.61498250548576);
    effector:SetKey(_TRACK_SY, 0.6, 0.79007024185833);
    effector:SetKey(_TRACK_SX, 0.72, 0.60281870166198);
    effector:SetKey(_TRACK_SY, 0.72, 0.66653848110853);
    effector:SetKey(_TRACK_SX, 0.8, 0.68473097741459);
    effector:SetKey(_TRACK_SY, 0.8, 1.0260425176801);
    effector:SetKey(_TRACK_SX, 0.84, 0.61326077540639);
    effector:SetKey(_TRACK_SY, 0.84, 0.86730770009509);
    effector:SetKey(_TRACK_SX, 0.92, 0.41776184638516);
    effector:SetKey(_TRACK_SY, 0.92, 0.64150110028712);
    effector:SetKey(_TRACK_O, 0, 1);
    effector:SetKey(_TRACK_O, 0.08, 0);
    effector:SetKey(_TRACK_O, 0.16, 1);
    effector:SetKey(_TRACK_O, 0.36, 0);
    effector:SetKey(_TRACK_O, 0.48, 1);
    effector:SetKey(_TRACK_O, 0.52, 0);
    effector:SetKey(_TRACK_O, 0.6, 1);
    effector:SetKey(_TRACK_O, 0.8, 1);
    effector:SetKey(_TRACK_O, 0.96, 1);

    effector:Play();


    -- Layer Layer_6
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/EF_burn01.jpg');
    element:SetName('Layer_6');
    compositionFire1:AddElement(element);
    element:SetHotSpot(16.5, 86.6666717529297);
    element:SetParentElement(compositionFire1);
    element:SetXY(49.4054107666016, 151.567565917969);

    element:SetAngle(0);

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

    effector:SetKey(_TRACK_SX, 0, 0.31428571428571);
    effector:SetKey(_TRACK_SY, 0, 0.31923080918351);
    effector:SetKey(_TRACK_SX, 0.08, 0.57142857142857);
    effector:SetKey(_TRACK_SY, 0.08, 0.66653848110853);
    effector:SetKey(_TRACK_SX, 0.28, 0.94285714285714);
    effector:SetKey(_TRACK_SY, 0.28, 0.86730770009509);
    effector:SetKey(_TRACK_SX, 0.4, 0.31688311688311);
    effector:SetKey(_TRACK_SY, 0.4, 0.79807693492731);
    effector:SetKey(_TRACK_SX, 0.56, 0.57142857142857);
    effector:SetKey(_TRACK_SY, 0.56, 0.66653848110853);
    effector:SetKey(_TRACK_SX, 0.72, -0.60857142857143);
    effector:SetKey(_TRACK_SY, 0.72, 0.86223077731612);
    effector:SetKey(_TRACK_SX, 0.76, 0.94285714285714);
    effector:SetKey(_TRACK_SY, 0.76, 0.86730770009509);
    effector:SetKey(_TRACK_SX, 0.88, 0.31688311688311);
    effector:SetKey(_TRACK_SY, 0.88, 0.79807693492731);
    effector:SetKey(_TRACK_O, 0, 0);
    effector:SetKey(_TRACK_O, 0.04, 1);
    effector:SetKey(_TRACK_O, 0.28, 0);
    effector:SetKey(_TRACK_O, 0.4, 1);
    effector:SetKey(_TRACK_O, 0.48, 0);
    effector:SetKey(_TRACK_O, 0.52, 1);
    effector:SetKey(_TRACK_O, 0.76, 0);
    effector:SetKey(_TRACK_O, 0.88, 1);
    effector:SetKey(_TRACK_O, 0.96, 0);

    effector:Play();

    compositionFire1:Play();

    return compositionFire1;
end

createCompositionFly1 = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/Bug_fly[01-02].png');
    element:SetName('Layer_1');
    compositionFly1:AddElement(element);
    element:SetHotSpot(9.5, 9);
    element:SetParentElement(compositionFly1);
    element:SetAngle(0);
    element:SetOpacity(1);

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

    effector:SetKey(_TRACK_X, 0, 454.534408569336);
    effector:SetKey(_TRACK_Y, 0, 789.331985473633);
    effector:SetKey(_TRACK_X, 0.24, 449.534408569336);
    effector:SetKey(_TRACK_Y, 0.24, 734.331985473633);
    effector:SetKey(_TRACK_X, 0.52, 427.534408569336);
    effector:SetKey(_TRACK_Y, 0.52, 678.331985473633);
    effector:SetKey(_TRACK_X, 0.84, 378.034408569336);
    effector:SetKey(_TRACK_Y, 0.84, 620.831985473633);
    effector:SetKey(_TRACK_X, 1.2, 298.034408569336);
    effector:SetKey(_TRACK_Y, 1.2, 564.831985473633);
    effector:SetKey(_TRACK_X, 1.52, 249.034408569336);
    effector:SetKey(_TRACK_Y, 1.52, 514.831985473633);
    effector:SetKey(_TRACK_X, 1.8, 234.034408569336);
    effector:SetKey(_TRACK_Y, 1.8, 458.831985473633);
    effector:SetKey(_TRACK_X, 2.04, 255.034408569336);
    effector:SetKey(_TRACK_Y, 2.04, 411.831985473633);
    effector:SetKey(_TRACK_X, 2.28, 297.034408569336);
    effector:SetKey(_TRACK_Y, 2.28, 374.831985473633);
    effector:SetKey(_TRACK_X, 2.52, 353.034408569336);
    effector:SetKey(_TRACK_Y, 2.52, 361.831985473633);
    effector:SetKey(_TRACK_X, 2.76, 418.034408569336);
    effector:SetKey(_TRACK_Y, 2.76, 372.831985473633);
    effector:SetKey(_TRACK_X, 2.96, 469.534408569336);
    effector:SetKey(_TRACK_Y, 2.96, 391.331985473633);
    effector:SetKey(_TRACK_X, 3.2, 517.034408569336);
    effector:SetKey(_TRACK_Y, 3.2, 415.331985473633);
    effector:SetKey(_TRACK_X, 3.44, 567.534408569336);
    effector:SetKey(_TRACK_Y, 3.44, 429.331985473633);
    effector:SetKey(_TRACK_X, 3.68, 618.034408569336);
    effector:SetKey(_TRACK_Y, 3.68, 430.331985473633);
    effector:SetKey(_TRACK_X, 3.92, 670.034408569336);
    effector:SetKey(_TRACK_Y, 3.92, 412.331985473633);
    effector:SetKey(_TRACK_X, 4.16, 717.034408569336);
    effector:SetKey(_TRACK_Y, 4.16, 372.331985473633);
    effector:SetKey(_TRACK_X, 4.4, 745.034408569336);
    effector:SetKey(_TRACK_Y, 4.4, 323.331985473633);
    effector:SetKey(_TRACK_X, 4.68, 747.034408569336);
    effector:SetKey(_TRACK_Y, 4.68, 257.331985473633);
    effector:SetKey(_TRACK_X, 4.96, 699.034408569336);
    effector:SetKey(_TRACK_Y, 4.96, 225.331985473633);
    effector:SetKey(_TRACK_X, 5.16, 649.034408569336);
    effector:SetKey(_TRACK_Y, 5.16, 224.331985473633);
    effector:SetKey(_TRACK_X, 5.4, 613.034408569336);
    effector:SetKey(_TRACK_Y, 5.4, 264.331985473633);
    effector:SetKey(_TRACK_X, 5.6, 612.534408569336);
    effector:SetKey(_TRACK_Y, 5.6, 312.831985473633);
    effector:SetKey(_TRACK_X, 5.8, 638.034408569336);
    effector:SetKey(_TRACK_Y, 5.8, 349.331985473633);
    effector:SetKey(_TRACK_X, 6, 688.034408569336);
    effector:SetKey(_TRACK_Y, 6, 384.831985473633);
    effector:SetKey(_TRACK_X, 6.24, 728.034408569336);
    effector:SetKey(_TRACK_Y, 6.24, 432.831985473633);
    effector:SetKey(_TRACK_X, 6.48, 734.034408569336);
    effector:SetKey(_TRACK_Y, 6.48, 486.831985473633);
    effector:SetKey(_TRACK_X, 6.72, 698.534408569336);
    effector:SetKey(_TRACK_Y, 6.72, 520.331985473633);
    effector:SetKey(_TRACK_X, 6.96, 647.534408569336);
    effector:SetKey(_TRACK_Y, 6.96, 516.331985473633);
    effector:SetKey(_TRACK_X, 7.2, 582.534408569336);
    effector:SetKey(_TRACK_Y, 7.2, 482.331985473633);
    effector:SetKey(_TRACK_X, 7.48, 547.534408569336);
    effector:SetKey(_TRACK_Y, 7.48, 454.831985473633);
    effector:SetKey(_TRACK_X, 7.8, 541.534408569336);
    effector:SetKey(_TRACK_Y, 7.8, 453.331985473633);
    effector:SetKey(_TRACK_X, 8.36, 551.534408569336);
    effector:SetKey(_TRACK_Y, 8.36, 449.831985473633);
    effector:SetKey(_TRACK_X, 8.64, 528.534408569336);
    effector:SetKey(_TRACK_Y, 8.64, 492.831985473633);
    effector:SetKey(_TRACK_X, 8.88, 518.034408569336);
    effector:SetKey(_TRACK_Y, 8.88, 546.331985473633);
    effector:SetKey(_TRACK_X, 9.12, 530.034408569336);
    effector:SetKey(_TRACK_Y, 9.12, 624.331985473633);
    effector:SetKey(_TRACK_X, 9.36, 557.034408569336);
    effector:SetKey(_TRACK_Y, 9.36, 704.831985473633);
    effector:SetKey(_TRACK_X, 9.64, 604.534408569336);
    effector:SetKey(_TRACK_Y, 9.64, 799.831985473633);
    effector:SetKey(_TRACK_X, 9.96, 604.534408569336);
    effector:SetKey(_TRACK_Y, 9.96, 799.831985473633);
    effector:SetKey(_TRACK_SX, 0, 2);
    effector:SetKey(_TRACK_SY, 0, 2);
    effector:SetKey(_TRACK_SX, 2.76, 1);
    effector:SetKey(_TRACK_SY, 2.76, 1);
    effector:SetKey(_TRACK_SX, 5.44, 0.8);
    effector:SetKey(_TRACK_SY, 5.44, 0.8);
    effector:SetKey(_TRACK_SX, 6.92, 1);
    effector:SetKey(_TRACK_SY, 6.92, 1);
    effector:SetKey(_TRACK_SX, 8.16, 1.1);
    effector:SetKey(_TRACK_SY, 8.16, 1.1);
    effector:SetKey(_TRACK_SX, 9.96, 2);
    effector:SetKey(_TRACK_SY, 9.96, 2);

    effector:Play();

    compositionFly1:Play();

    return compositionFly1;
end

createCompositionFly2 = function()

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


    -- Layer Layer_1
    local element = auxCreateCompositionElement('data/Texture/Scenes/13_TribeLeaderHut/Animations/Env/Bug_fly[01-02].png');
    element:SetName('Layer_1');
    compositionFly2:AddElement(element);
    element:SetHotSpot(9.5, 9);
    element:SetParentElement(compositionFly2);
    element:SetAngle(0);
    element:SetOpacity(1);

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

    effector:SetKey(_TRACK_X, 0, 1059);
    effector:SetKey(_TRACK_Y, 0, 403.5);
    effector:SetKey(_TRACK_X, 0.2, 982);
    effector:SetKey(_TRACK_Y, 0.2, 390.5);
    effector:SetKey(_TRACK_X, 0.44, 906);
    effector:SetKey(_TRACK_Y, 0.44, 400.5);
    effector:SetKey(_TRACK_X, 0.64, 860.5);
    effector:SetKey(_TRACK_Y, 0.64, 421.5);
    effector:SetKey(_TRACK_X, 0.84, 822);
    effector:SetKey(_TRACK_Y, 0.84, 454.5);
    effector:SetKey(_TRACK_X, 1.04, 789.5);
    effector:SetKey(_TRACK_Y, 1.04, 497);
    effector:SetKey(_TRACK_X, 1.28, 754.5);
    effector:SetKey(_TRACK_Y, 1.28, 545);
    effector:SetKey(_TRACK_X, 1.48, 723.5);
    effector:SetKey(_TRACK_Y, 1.48, 574);
    effector:SetKey(_TRACK_X, 1.68, 694);
    effector:SetKey(_TRACK_Y, 1.68, 587);
    effector:SetKey(_TRACK_X, 1.88, 660);
    effector:SetKey(_TRACK_Y, 1.88, 584);
    effector:SetKey(_TRACK_X, 2.12, 621);
    effector:SetKey(_TRACK_Y, 2.12, 551.5);
    effector:SetKey(_TRACK_X, 2.36, 598.5);
    effector:SetKey(_TRACK_Y, 2.36, 502.5);
    effector:SetKey(_TRACK_X, 2.56, 587.5);
    effector:SetKey(_TRACK_Y, 2.56, 459.5);
    effector:SetKey(_TRACK_X, 2.8, 578.5);
    effector:SetKey(_TRACK_Y, 2.8, 410.5);
    effector:SetKey(_TRACK_X, 3.04, 579);
    effector:SetKey(_TRACK_Y, 3.04, 351);
    effector:SetKey(_TRACK_X, 3.28, 583.5);
    effector:SetKey(_TRACK_Y, 3.28, 296);
    effector:SetKey(_TRACK_X, 3.52, 597.5);
    effector:SetKey(_TRACK_Y, 3.52, 247);
    effector:SetKey(_TRACK_X, 3.72, 618);
    effector:SetKey(_TRACK_Y, 3.72, 194.5);
    effector:SetKey(_TRACK_X, 3.96, 620);
    effector:SetKey(_TRACK_Y, 3.96, 146);
    effector:SetKey(_TRACK_X, 4.12, 591.5);
    effector:SetKey(_TRACK_Y, 4.12, 118.5);
    effector:SetKey(_TRACK_X, 4.32, 552.5);
    effector:SetKey(_TRACK_Y, 4.32, 110.5);
    effector:SetKey(_TRACK_X, 4.48, 515);
    effector:SetKey(_TRACK_Y, 4.48, 111);
    effector:SetKey(_TRACK_X, 4.68, 470.5);
    effector:SetKey(_TRACK_Y, 4.68, 125.5);
    effector:SetKey(_TRACK_X, 4.92, 447.5);
    effector:SetKey(_TRACK_Y, 4.92, 154.5);
    effector:SetKey(_TRACK_X, 5.16, 450.5);
    effector:SetKey(_TRACK_Y, 5.16, 190.5);
    effector:SetKey(_TRACK_X, 5.44, 491);
    effector:SetKey(_TRACK_Y, 5.44, 225);
    effector:SetKey(_TRACK_X, 5.64, 540);
    effector:SetKey(_TRACK_Y, 5.64, 235);
    effector:SetKey(_TRACK_X, 5.88, 586);
    effector:SetKey(_TRACK_Y, 5.88, 222);
    effector:SetKey(_TRACK_X, 6.16, 605);
    effector:SetKey(_TRACK_Y, 6.16, 177);
    effector:SetKey(_TRACK_X, 6.4, 580.5);
    effector:SetKey(_TRACK_Y, 6.4, 144.5);
    effector:SetKey(_TRACK_X, 6.72, 533.5);
    effector:SetKey(_TRACK_Y, 6.72, 132);
    effector:SetKey(_TRACK_X, 6.96, 491);
    effector:SetKey(_TRACK_Y, 6.96, 144.5);
    effector:SetKey(_TRACK_X, 7.2, 471);
    effector:SetKey(_TRACK_Y, 7.2, 168.5);
    effector:SetKey(_TRACK_X, 7.44, 485.5);
    effector:SetKey(_TRACK_Y, 7.44, 195.5);
    effector:SetKey(_TRACK_X, 7.64, 515.5);
    effector:SetKey(_TRACK_Y, 7.64, 206.5);
    effector:SetKey(_TRACK_X, 7.88, 555);
    effector:SetKey(_TRACK_Y, 7.88, 204.5);
    effector:SetKey(_TRACK_X, 8.12, 581.5);
    effector:SetKey(_TRACK_Y, 8.12, 180);
    effector:SetKey(_TRACK_X, 8.36, 560.5);
    effector:SetKey(_TRACK_Y, 8.36, 154);
    effector:SetKey(_TRACK_X, 8.68, 523.5);
    effector:SetKey(_TRACK_Y, 8.68, 150);
    effector:SetKey(_TRACK_X, 8.96, 494);
    effector:SetKey(_TRACK_Y, 8.96, 167.5);
    effector:SetKey(_TRACK_X, 9.24, 505.5);
    effector:SetKey(_TRACK_Y, 9.24, 189.5);
    effector:SetKey(_TRACK_X, 9.44, 539.5);
    effector:SetKey(_TRACK_Y, 9.44, 192);
    effector:SetKey(_TRACK_X, 9.68, 557);
    effector:SetKey(_TRACK_Y, 9.68, 166);
    effector:SetKey(_TRACK_X, 9.96, 572);
    effector:SetKey(_TRACK_Y, 9.96, 108);
    effector:SetKey(_TRACK_SX, 0, 1.6);
    effector:SetKey(_TRACK_SY, 0, 1.6);
    effector:SetKey(_TRACK_SX, 2.24, 1);
    effector:SetKey(_TRACK_SY, 2.24, 1);
    effector:SetKey(_TRACK_SX, 6.32, 0.8);
    effector:SetKey(_TRACK_SY, 6.32, 0.8);
    effector:SetKey(_TRACK_SX, 7.72, 0.4);
    effector:SetKey(_TRACK_SY, 7.72, 0.4);
    effector:SetKey(_TRACK_SX, 8.56, 0.8);
    effector:SetKey(_TRACK_SY, 8.56, 0.8);
    effector:SetKey(_TRACK_SX, 9.4, 0.4);
    effector:SetKey(_TRACK_SY, 9.4, 0.4);
    effector:SetKey(_TRACK_SX, 9.96, 0.4);
    effector:SetKey(_TRACK_SY, 9.96, 0.4);

    effector:Play();

    compositionFly2:Play();

    return compositionFly2;
end

createCompositionTorchesFire = function()

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


    -- Layer Layer_1
    local element = createCompositionFire1();
    element:SetName('Layer_1');
    compositionTorchesFire:AddElement(element);
    element:SetHotSpot(50, 156.25);
    element:SetParentElement(compositionTorchesFire);
    element:SetXY(663, 384);

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

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


    effector:Play();


    -- Layer Layer_2
    local element = createCompositionFire1();
    element:SetName('Layer_2');
    compositionTorchesFire:AddElement(element);
    element:SetHotSpot(50, 156.25);
    element:SetParentElement(compositionTorchesFire);
    element:SetXY(770.5, 382.5);

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

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


    effector:Play();


    -- Layer Layer_3
    local element = createCompositionFire1();
    element:SetName('Layer_3');
    compositionTorchesFire:AddElement(element);
    element:SetHotSpot(50, 156.25);
    element:SetParentElement(compositionTorchesFire);
    element:SetXY(371.5, 384.5);

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

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


    effector:Play();


    -- Layer Layer_4
    local element = createCompositionFire1();
    element:SetName('Layer_4');
    compositionTorchesFire:AddElement(element);
    element:SetHotSpot(50, 156.25);
    element:SetParentElement(compositionTorchesFire);
    element:SetXY(277, 378.5);

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

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


    effector:Play();

    compositionTorchesFire:Play();

    return compositionTorchesFire;
end

