dofile('data/Scripts/Minigames/minigameScreen.lua');
-- miniGameScreen
------------------------------------------------------------------------------

function OnSceneLoad()
	play_field = miniGamePlayField;
    LoadData();
	play_field = nil;
	
	miniGameState = {};
   	miniGameState.delayPeriod = 90.0;
   	miniGameState.timeElapsed = 0.0;
   	miniGameState.delayPeriodPassed = false;
   	miniGameState.completed = false;
   	miniGameState.locked = true;
   	
   	miniGamePlayField:GetObject('Gong_back_H01'):SetVisible(false)
   	miniGamePlayField:GetObject('Gong_reset_H01'):SetVisible(false)
   	
	PoleXY = {};
	PoleXY[1] = {265, 229}
	PoleXY[2] = {355, 266}
	PoleXY[3] = {451, 280}
	PoleXY[4] = {554, 242}
	PoleXY[5] = {642, 292}
	PoleXY[6] = {734, 257}
	PoleXY[7] = {814, 230}
	
	PoleFlag = {false, false, false, true, false, false, false};
	PoleAray = {}
	
	OBJECTS_AMOUNT = 6
	TYPE_RIGHT_ORIENTIRE = 1;
	TYPE_LEFT_ORIENTIRE = 2;
	
	game_active = true;
	Objects = {}
	
	for i = 1, 6 do
		Objects[i] = {}
		Objects[i].Entity = miniGamePlayField:GetObject("idle_"..i);
		Objects[i].JumpEntity = miniGamePlayField:GetObject("aktio_"..i);
		Objects[i].JumpEntity:GetAnimation():Stop();
		Objects[i].JumpEntity:SetVisible(false);
		
		Objects[i].Index = i;
		
		if(i < 4) then
			Objects[i].Type = TYPE_RIGHT_ORIENTIRE;
			Objects[i].Pole = i;
		else
			Objects[i].Type = TYPE_LEFT_ORIENTIRE;
			Objects[i].Pole = i + 1;
		end
		Objects[i].Entity:GetAnimation():Stop();
		TimerDoString('Objects['..i..'].Entity:GetAnimation():Play()', math.random(100) / 100, miniGamePlayField:GetTimer());
	end
	
	vagonetkaComposition = BuildVagonetkaComposition();
	vagonetkaComposition:AttachTo(miniGameScreen);
	vagonetkaComposition:SetZ(105);
	vagonetkaComposition:Stop();
	
	---------------------------------------------------------------------------------------------------------
	StepsArray = {}
	---------------------------------------------------------------------------------------------------------
	
   	TimerDoString('OnShowHelp()', 0.5, miniGamePlayField:GetTimer());
end

function auxPushBack(_index, _place)
	local step = {};
	
	step.index = _index;
	step.place = _place;
	
	Lenght = table.getn(StepsArray);
	StepsArray[Lenght + 1] = step;
end

function auxPopBack()
	StepsArray[table.getn(StepsArray)] = nil;
end

function auxClearHistory()
    for i = table.getn(StepsArray), 1, -1 do
    	StepsArray[i] = nil;
    end
end

function auxGetLastStep()
	local Index = table.getn(StepsArray);
	
	if (Index == 0) then
		return nil;
	end
	
	return StepsArray[Index];
end

function auxGetArrayLenght()
	return table.getn(StepsArray);
end


function OnSceneFree()
    FreeData()
end

--// auxiliary functions -----------------------------------------------------
--// ...
function GetObjectByName(object_name)
	for i = 1, OBJECTS_AMOUNT do
		if(Objects[i].Entity:GetName() == object_name) then
			return Objects[i];
		end
	end
	
	return nil;
end

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function IsComplited()
	for i = 1,3 do
		if(Objects[i].Pole < 5) then
			return false;
		end
	end
	
	for i = 4,6 do
		if(Objects[i].Pole > 3) then
			return false;
		end
	end
	
	return true;
end

function OnUpdate(dt)
	miniGameState.timeElapsed = miniGameState.timeElapsed + dt;
	auxUpdateProgressBar(miniGameState.timeElapsed > miniGameState.delayPeriod and 1.0 or miniGameState.timeElapsed / miniGameState.delayPeriod);
	
    if (miniGameState.completed == false and
        miniGameState.delayPeriodPassed == false and miniGameState.timeElapsed > miniGameState.delayPeriod) then
        miniGameState.delayPeriodPassed = true;
        auxShowButton(false);
    end
    
end

function OnShowHelp()
	miniGamePlayField:GetLevelScreen():ShowDialog(500, 300, GetTextString('MINIGAME_DINO_HELP'), GetTextString('MINIGAME_HELP_DIALOG_TITLE'));
end

function OnObjectMouseDown(object)
	local obj = GetObjectByName(object:GetName());
	
	if(obj ~= nil and game_active == true) then
		local index = 0;
		if (obj.Type == TYPE_RIGHT_ORIENTIRE and PoleFlag[obj.Pole + 1] == true) then
			index = 1;
		elseif (obj.Type == TYPE_LEFT_ORIENTIRE and PoleFlag[obj.Pole - 1] == true) then
			index = -1;
		elseif (obj.Type == TYPE_RIGHT_ORIENTIRE and PoleFlag[obj.Pole + 2] == true) then
			index = 2;
		elseif (obj.Type == TYPE_LEFT_ORIENTIRE and PoleFlag[obj.Pole - 2] == true) then
			index = -2;
		end
		
		if(index ~= 0) then
			auxPushBack(obj.Index, obj.Pole);
		end
		
		obj.Entity:SetVisible(false);
		obj.JumpEntity:SetVisible(true);
		obj.JumpEntity:SetXY(obj.Entity:GetX(), obj.Entity:GetY());
		if(obj.Index < 4) then
			obj.JumpEntity:SetScaleX(1);
			obj.JumpEntity:GetAnimation():SetHotSpot(128, 128);
		else
			obj.JumpEntity:SetScaleX(-1);
			obj.JumpEntity:GetAnimation():SetHotSpot(100, 128);
		end
		obj.JumpEntity:GetAnimation():Play();
		local time = GetAnimationLength(obj.JumpEntity:GetAnimation());
		game_active = false;
		
		Jump(obj.JumpEntity, time, PoleXY[obj.Pole + index][1], PoleXY[obj.Pole + index][2], 200);
		StopSound('L05S01');
		PlaySound('L05S01');

		PoleFlag[obj.Pole] = true;
		PoleFlag[obj.Pole + index] = false;
		obj.Pole = obj.Pole + index;
		
		TimerDoString('game_active = true', time, miniGamePlayField:GetTimer());
		--TimerDoString('Objects['..obj.Index..'].JumpEntity:GetAnimation():Play()', time, miniGamePlayField:GetTimer());
		TimerDoString('Objects['..obj.Index..'].JumpEntity:SetVisible(false)', time, miniGamePlayField:GetTimer());
		TimerDoString('Objects['..obj.Index..'].Entity:SetVisible(true)', time, miniGamePlayField:GetTimer());
		TimerDoString('Objects['..obj.Index..'].Entity:SetXY(Objects['..obj.Index..'].JumpEntity:GetX(), Objects['..obj.Index..'].JumpEntity:GetY())', time, miniGamePlayField:GetTimer());
		
		if(IsComplited() == true) then
			TimerDoString('FinishAnimation()', time, miniGamePlayField:GetTimer());
		end
	end
	
	--step back
	if(object:GetName() == "actZone_1" and game_active == true) then
		JumpBack();
	end
	
	--reverce
	if(object:GetName() == "actZone_2" and game_active == true) then
		local time = GetAnimationLength(Objects[1].JumpEntity:GetAnimation());
		game_active = false;
		for i = 1, OBJECTS_AMOUNT do
			if(i < 4) then
				Objects[i].JumpEntity:SetScaleX(-1);
				Objects[i].JumpEntity:GetAnimation():SetHotSpot(100, 128);
				
				Objects[i].Pole = i;
				TimerDoString('Objects['..i..'].Entity:SetXY(PoleXY['..i..'][1], PoleXY['..i..'][2])', 1.0, miniGamePlayField:GetTimer());
			else
				Objects[i].JumpEntity:SetScaleX(1);
				Objects[i].JumpEntity:GetAnimation():SetHotSpot(128, 128);
				Objects[i].Pole = i + 1; 
				TimerDoString('Objects['..i..'].Entity:SetXY(PoleXY['..(i + 1)..'][1], PoleXY['..(i + 1)..'][2])', 1.0, miniGamePlayField:GetTimer());
			end
			BirdJump(i, math.random(100) + 50);
			TimerDoString('game_active = true', time, miniGamePlayField:GetTimer());
		end
		
		PlaySound('L05S02')
		
		--GoHome();
		for i = 1,7 do
			PoleFlag[i] = false;
		end
		PoleFlag[4] = true;
		auxClearHistory()
	end
end

function FinishAnimation()
	game_active = false;
	
	for i = 1,OBJECTS_AMOUNT do
		TimerDoString('BirdJump('..i..', math.random(100) + 50)',  (i - 1)* 0.2, miniGamePlayField:GetTimer());
	end
	
	local time = GetAnimationLength(Objects[1].JumpEntity:GetAnimation());
	TimerDoString('auxShowButton(true)', time + (OBJECTS_AMOUNT - 1)* 0.2, miniGamePlayField:GetTimer());
	TimerDoString('vagonetkaComposition:Play()', time + (OBJECTS_AMOUNT - 1)* 0.2, miniGamePlayField:GetTimer());
	miniGameState.completed = true;
	auxShowButton(true);
end

function JumpBack()
	cur_step = auxGetLastStep();
		
	if(cur_step ~= nil) then
		local time = GetAnimationLength(Objects[1].JumpEntity:GetAnimation());
		game_active = false;
		TimerDoString('game_active = true', time, miniGamePlayField:GetTimer());
		
		PoleFlag[Objects[cur_step.index].Pole] = true;
		
		if(cur_step.index < 4) then
			Objects[cur_step.index].JumpEntity:SetScaleX(-1);
			Objects[cur_step.index].JumpEntity:GetAnimation():SetHotSpot(100, 128);
			Objects[cur_step.index].Pole = cur_step.place;
			TimerDoString('Objects['..cur_step.index..'].Entity:SetXY(PoleXY['..cur_step.index..'][1], PoleXY['..cur_step.index..'][2])', 1.0, miniGamePlayField:GetTimer());
		else
			Objects[cur_step.index].JumpEntity:SetScaleX(1);
			Objects[cur_step.index].JumpEntity:GetAnimation():SetHotSpot(128, 128);
			Objects[cur_step.index].Pole = cur_step.place; 
			TimerDoString('Objects['..cur_step.index..'].Entity:SetXY(PoleXY['..(cur_step.index + 1)..'][1], PoleXY['..(cur_step.index + 1)..'][2])', 1.0, miniGamePlayField:GetTimer());
		end
		PoleFlag[Objects[cur_step.index].Pole] = false;
		BirdJump(cur_step.index, 150);
		
		PlaySound('L05S01')
		
		auxPopBack();
	end
end

function BirdJump(index, height)
	Objects[index].Entity:SetVisible(false);
	Objects[index].JumpEntity:SetVisible(true);
	Objects[index].JumpEntity:SetXY(Objects[index].Entity:GetX(), Objects[index].Entity:GetY());
	local time = GetAnimationLength(Objects[index].JumpEntity:GetAnimation());
	Jump(Objects[index].JumpEntity, time, PoleXY[Objects[index].Pole][1], PoleXY[Objects[index].Pole][2], height);
	Objects[index].JumpEntity:GetAnimation():Play();
	
	TimerDoString('Objects['..index..'].JumpEntity:SetVisible(false)', time, miniGamePlayField:GetTimer());
	TimerDoString('Objects['..index..'].Entity:SetVisible(true)', time, miniGamePlayField:GetTimer());
	TimerDoString('Objects['..index..'].Entity:SetXY(Objects['..index..'].JumpEntity:GetX(), Objects['..index..'].JumpEntity:GetY())', time, miniGamePlayField:GetTimer());
end

function Jump(object, time, new_x, new_y, height)
	local af = CreateAnimationEffector()--AnimationEffector()

    af:AttachTo(object)
    af:SetKey(_TRACK_X, 0.0, 						object:GetX())
    af:SetKey(_TRACK_Y, 0.0, 						object:GetY())
    
    af:SetKey(_TRACK_X, time / 2 - time / 4, 		object:GetX())
    
    af:SetKey(_TRACK_Y, time / 2, 					object:GetY() - height)
    
    af:SetKey(_TRACK_X, time / 2 + time / 4, 		new_x)
    
    af:SetKey(_TRACK_Y, time, 						new_y)
    af:Play()
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnMouseMove(previousPos, currentPos)
end

function OnObjectMouseEnter(object)
    if object:GetName() == 'actZone_1' then
        miniGamePlayField:GetObject('Gong_back_H01'):SetVisible(true)
    elseif object:GetName() == 'actZone_2' then
        miniGamePlayField:GetObject('Gong_reset_H01'):SetVisible(true)
    end
end

function OnObjectMouseLeave(object)
    if object:GetName() == 'actZone_1' then
        miniGamePlayField:GetObject('Gong_back_H01'):SetVisible(false)
    elseif object:GetName() == 'actZone_2' then
        miniGamePlayField:GetObject('Gong_reset_H01'):SetVisible(false)
    end
end

function BuildVagonetkaComposition()

    createCompositionBG_Mini_game_Dino = function()
    
        local compositionBG_Mini_game_Dino = CreateCompositionSequence();
        local compositionDuration = 2.04;
        compositionBG_Mini_game_Dino:SetDuration(compositionDuration);
    
    
        -- Layer kirka
        local element = CreateCompositionElement("data/Texture/Minigames/Dino/kirka2.png");
        element:SetName("kirka");
        compositionBG_Mini_game_Dino:AddElement(element);
        element:SetHotSpot(30, 45);
        element:SetParentElement(compositionBG_Mini_game_Dino);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 2.04);
    
        effector:SetKey(_TRACK_X, 0, 540);
        effector:SetKey(_TRACK_Y, 0, 117);
        effector:SetKey(_TRACK_X, 0.08, 542);
        effector:SetKey(_TRACK_Y, 0.08, 124);
        effector:SetKey(_TRACK_X, 0.24, 542);
        effector:SetKey(_TRACK_Y, 0.24, 127.5);
        effector:SetKey(_TRACK_X, 0.56, 531.5);
        effector:SetKey(_TRACK_Y, 0.56, 127.5);
        effector:SetKey(_TRACK_X, 0.64, 513);
        effector:SetKey(_TRACK_Y, 0.64, 125.5);
        effector:SetKey(_TRACK_X, 0.88, 498);
        effector:SetKey(_TRACK_Y, 0.88, 171);
        effector:SetKey(_TRACK_X, 1.12, 489);
        effector:SetKey(_TRACK_Y, 1.12, 235.5);
        effector:SetKey(_TRACK_X, 1.68, 464);
        effector:SetKey(_TRACK_Y, 1.68, 553.5);
        effector:SetKey(_TRACK_SX, 0, 1);
        effector:SetKey(_TRACK_SY, 0, 1);
        effector:SetKey(_TRACK_SX, 1.68, 1.1);
        effector:SetKey(_TRACK_SY, 1.68, 1.1);
        effector:SetKey(_TRACK_SX, 1.76, 1.2);
        effector:SetKey(_TRACK_SY, 1.76, 1.2);
        effector:SetKey(_TRACK_SX, 1.84, 1.1);
        effector:SetKey(_TRACK_SY, 1.84, 1.1);
        effector:SetKey(_TRACK_A, 0, 0);
        effector:SetKey(_TRACK_A, 0.24, -0.26625204884669);
        effector:SetKey(_TRACK_A, 0.56, -0.00325731746629);
        effector:SetKey(_TRACK_A, 0.64, 0.24537540950291);
        effector:SetKey(_TRACK_A, 0.88, 1.69240155629119);
        effector:SetKey(_TRACK_A, 1.16, 4.04638093543047);
        effector:SetKey(_TRACK_A, 1.68, 14.5535984664286);
    
        effector:Play();    
    
        -- Layer vagonetka
        local element = CreateCompositionElement("data/Texture/Minigames/Dino/Vagonetka.png");
        element:SetName("vagonetka");
        compositionBG_Mini_game_Dino:AddElement(element);
        element:SetHotSpot(108, 125.5);
        element:SetParentElement(compositionBG_Mini_game_Dino);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 2.04);
    
        effector:SetKey(_TRACK_X, 0, 654.5);
        effector:SetKey(_TRACK_Y, 0, 166.5);
        effector:SetKey(_TRACK_X, 0.08, 655.5);
        effector:SetKey(_TRACK_Y, 0.08, 172.5);
        effector:SetKey(_TRACK_X, 0.24, 646.5);
        effector:SetKey(_TRACK_Y, 0.24, 172.5);
        effector:SetKey(_TRACK_X, 0.56, 641.5);
        effector:SetKey(_TRACK_Y, 0.56, 176.5);
        effector:SetKey(_TRACK_X, 0.64, 630.5);
        effector:SetKey(_TRACK_Y, 0.64, 178.5);
        effector:SetKey(_TRACK_X, 0.72, 627.5);
        effector:SetKey(_TRACK_Y, 0.72, 182.5);
        effector:SetKey(_TRACK_X, 0.76, 621.5);
        effector:SetKey(_TRACK_Y, 0.76, 182.5);
        effector:SetKey(_TRACK_X, 0.96, 583.5);
        effector:SetKey(_TRACK_Y, 0.96, 219.5);
        effector:SetKey(_TRACK_X, 1.32, 457.5);
        effector:SetKey(_TRACK_Y, 1.32, 307.5);
        effector:SetKey(_TRACK_X, 1.56, 363.5);
        effector:SetKey(_TRACK_Y, 1.56, 367.5);
        effector:SetKey(_TRACK_X, 1.72, 289.5);
        effector:SetKey(_TRACK_Y, 1.72, 576.5);
        effector:SetKey(_TRACK_SX, 1.72, 1);
        effector:SetKey(_TRACK_SY, 1.72, 1);
        effector:SetKey(_TRACK_SX, 1.8, 1.05);
        effector:SetKey(_TRACK_SY, 1.8, 1.05);
        effector:SetKey(_TRACK_SX, 1.88, 1);
        effector:SetKey(_TRACK_SY, 1.88, 1);
        effector:SetKey(_TRACK_A, 1.32, 0);
        effector:SetKey(_TRACK_A, 1.56, -0.40368004836304);
        effector:SetKey(_TRACK_A, 1.72, -0.80726662192165);
    
        effector:Play();
    
    
        -- Layer relsi
        local element = CreateCompositionElement("data/Texture/Minigames/Dino/Relsi.png");
        element:SetName("relsi");
        compositionBG_Mini_game_Dino:AddElement(element);
        element:SetHotSpot(571, 24.5);
        element:SetParentElement(compositionBG_Mini_game_Dino);
        element:SetXY(922, 58);
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 2.04);
    
        effector:SetKey(_TRACK_A, 0, 0);
        effector:SetKey(_TRACK_A, 0.08, -0.01599593928517);
        effector:SetKey(_TRACK_A, 0.24, -0.00331416954954);
        effector:SetKey(_TRACK_A, 0.56, -0.00799984384052);
        effector:SetKey(_TRACK_A, 0.64, -0.00125925421999);
        effector:SetKey(_TRACK_A, 0.72, -0.00951848730639);
        effector:SetKey(_TRACK_A, 0.76, -0.0028964617573);
        effector:SetKey(_TRACK_A, 0.96, -0.03652453257456);
        effector:SetKey(_TRACK_A, 1.32, -0.05927099001203);
        effector:SetKey(_TRACK_A, 1.52, -0.0054343365063);
        effector:SetKey(_TRACK_A, 1.64, -0.03132551183013);
        effector:SetKey(_TRACK_A, 1.76, -0.01297488111888);
        effector:SetKey(_TRACK_A, 1.84, -0.02703263470307);
        effector:SetKey(_TRACK_A, 1.92, -0.02006990293899);
    
        effector:Play();
    
		compositionBG_Mini_game_Dino:Play();
    
        return compositionBG_Mini_game_Dino;
    end
    
    local result = createCompositionBG_Mini_game_Dino();
    result:SetDestroysOnEnd(false);
--    result:SetConsiderParentOpacity(false);
	return result;

end

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData()
	local anim = CreateAnimation('data/Texture/Minigames/Dino/Mini_game_Dino.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Mini_game_Dino',anim,509,383,99,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/aktio.png',0,0,256,256,35,15)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('aktio_1',anim,200,670,251,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/aktio.png',0,0,256,256,35,15)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('aktio_2',anim,200,670,252,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/aktio.png',0,0,256,256,35,15)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('aktio_3',anim,200,670,253,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/aktio2.png',0,0,256,256,35,15)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('aktio_4',anim,200,670,254,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/aktio2.png',0,0,256,256,35,15)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('aktio_5',anim,200,670,255,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/aktio2.png',0,0,256,256,35,15)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('aktio_6',anim,200,670,256,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/idle.png',0,0,256,256,30,10)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('idle_1',anim,265,229,261,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/idle.png',0,0,256,256,30,20)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('idle_2',anim,355,266,262,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/idle.png',0,0,256,256,30,20)
	anim:SetHotSpot(128,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('idle_3',anim,451,280,263,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/idle2.png',0,0,256,256,30,20)
	anim:SetHotSpot(100,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('idle_4',anim,642,292,266,0,-1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/idle2.png',0,0,256,256,30,20)
	anim:SetHotSpot(100,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('idle_5',anim,734,257,265,0,-1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/idle2.png',0,0,256,256,30,20)
	anim:SetHotSpot(100,128)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('idle_6',anim,814,230,264,0,-1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/Zerdochka.png',0,0,968,134,1,0)
	anim:SetHotSpot(484,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Zerdochka',anim,523,356,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/1_plan.png',0,0,1028,772,1,0)
	anim:SetHotSpot(514,386)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('1_plan',anim,511,386,199,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/Gong_back01.png',0,0,147,205,1,0)
	anim:SetHotSpot(73,102)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Gong_back01',anim,440,505,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/Gong_reset01.png',0,0,146,216,1,0)
	anim:SetHotSpot(73,108)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Gong_reset01',anim,623,511,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZone_1',anim,442,512,202,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZone_2',anim,624,516,202,0,0.9,0.9)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/Gong_back_H01.png',0,0,147,205,1,0)
	anim:SetHotSpot(73,102)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Gong_back_H01',anim,440,505,201,0,1,1)
	local anim = CreateAnimation('data/Texture/Minigames/Dino/Gong_reset_H01.png',0,0,146,216,1,0)
	anim:SetHotSpot(73,108)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Gong_reset_H01',anim,623,511,201,0,1,1)
end

function FreeData()
end
-- CLEAR_ON_SAVE_END
