print("Init Mission Ogorod")

local vault = resourceManager:getVault(ResourceManager.COMMON)

local loadingLabel = KrTextBox(game:getFontResource("occ24"), 150, 35, 1, KrTextBox.LEFT)
--loadingLabel:SetPos(10, 10, -1)
loadingLabel:SetPos(10, -500, -1)
setNodeScale(loadingLabel, 9)

mission:setLoadingLabel(loadingLabel)


resourceManager:initBoxVault("box2")
local boxVault = resourceManager:getBoxVault()

 local spr = KrSprite(boxVault:GetSpriteResource("bg"))
-- local spr = KrSprite(boxVault:GetSpriteResource("shel_4"))

createNameBox2(boxVault, spr, game, mission)


local startBorderX = 321 ;
local startBorderY = 265;

placeStandBorder(boxVault, spr, "o-lu", startBorderX, startBorderY, 0, 0)
placeStandBorder(boxVault, spr, "o-ru", startBorderX, startBorderY, 6, 0)
placeStandBorder(boxVault, spr, "o-rd", startBorderX, startBorderY, 6, 3)
placeStandBorder(boxVault, spr, "o-ld", startBorderX, startBorderY, 0, 2)
placeStandBorder(boxVault, spr, "o-ld", startBorderX, startBorderY, 1, 3)
placeStandBorder(boxVault, spr, "i-ru", startBorderX, startBorderY, 1, 2)

for i = 2, 5 do
	placeStandBorder(boxVault, spr, "o-u", startBorderX, startBorderY, i, 0)
	placeStandBorder(boxVault, spr, "o-d", startBorderX, startBorderY, i, 3)
end

placeStandBorder(boxVault, spr, "o-u", startBorderX, startBorderY, 1, 0)

placeStandBorder(boxVault, spr, "o-l", startBorderX, startBorderY, 0, 1)

for i = 1, 2 do
	placeStandBorder(boxVault, spr, "o-r", startBorderX, startBorderY, 6, i)
end


local coreRoot = mission:getCoreRoot();


local stand = KrSprite(boxVault:GetSpriteResource("pupitr"))
stand:SetPos(194, 104 - 64 * 3, -1);
-- setNodeScale(stand, 0.83, 0.80);
stand:SetZDepth(-18);
addNodeAdopt(stand, coreRoot)

stand = KrSprite(boxVault:GetSpriteResource("setka0"))
stand:SetPos(211 - 15 - 7 + 4, 110 - 2 - 64 * 3 + 12 - 47, -1);
stand:SetZDepth(-18);
addNodeAdopt(stand, coreRoot)



local luIdx = 0;
local ruIdx = 1;
local ldIdx = 3;
local rdIdx = 2;

mission:setGroupCounts(4, 6);

addMusicianPianBox2(boxVault, 2.17, "lu", coreRoot, mission, luIdx)
addMusicianPianBox2(boxVault, 2.17, "ru", coreRoot, mission, ruIdx)
addMusicianSkripBox2(boxVault, 2.17, "rd", coreRoot, mission, rdIdx)
addMusicianManBox2(boxVault, 2.17 * 2, "ld", coreRoot, mission, ldIdx)


-- бэки дырок под поршни

wndbg = KrSprite(boxVault:GetSpriteResource("shel_1"))
wndbg:SetPos(199, 310, -1);
wndbg:SetZDepth(-9);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("shel_2"))
wndbg:SetPos(820, 310, -1);
wndbg:SetZDepth(-9);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("shel_3"))
wndbg:SetPos(121, 496, -1);
wndbg:SetZDepth(-9);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("shel_4"))
wndbg:SetPos(897, 498, -1);
wndbg:SetZDepth(-9);
addNodeAdopt(wndbg, coreRoot)


-- стержни

	-- 1

local cylX = 127;
local cylY = 259;
local cylShift = 15;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

local porsh1 = Porsh(coreRoot)
local porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 40, -1);
porsh1:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;


wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh1:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 30, -1);
porsh1:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 40, -1);
porsh1:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh1:addPorsh(porshSpr, 0, 41, 30);


porsh1:getRoot():SetPos(0, cylY, -1);
porsh1:getRoot():SetZDepth(-7);
mission:addAnimationNode(porsh1, luIdx)

	-- 2

cylX = 828;
cylY = 258;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

local porsh2 = Porsh(coreRoot)
porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh2:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 30, -1);
porsh2:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 40, -1);
porsh2:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh2:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 30, -1);
porsh2:addPorsh(porshSpr, 0, 41, 30);

porsh2:getRoot():SetPos(0, cylY, -1);
porsh2:getRoot():SetZDepth(-7);
mission:addAnimationNode(porsh2, ruIdx)

	-- 3

cylX = 127;
cylY = 446;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

local porsh3 = Porsh(coreRoot)
porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 30, -1);
porsh3:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh3:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 40, -1);
porsh3:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh3:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 30, -1);
porsh3:addPorsh(porshSpr, 0, 41, 30);

porsh3:getRoot():SetPos(0, cylY, -1);
porsh3:getRoot():SetZDepth(-7);
mission:addAnimationNode(porsh3, ldIdx)

	-- 4

cylX = 828;
cylY = 449;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

local porsh4 = Porsh(coreRoot)
porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 40, -1);
porsh4:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh4:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 30, -1);
porsh4:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 20, -1);
porsh4:addPorsh(porshSpr, 0, 41, 30);

cylX = cylX + cylShift;

wndbg = KrSprite(boxVault:GetSpriteResource("porsh_cyl"))
wndbg:SetPos(cylX, cylY, -1);
wndbg:SetZDepth(-8);
addNodeAdopt(wndbg, coreRoot)

porshSpr = KrSprite(boxVault:GetSpriteResource("porsh_val"))
porshSpr:SetPos(cylX - 3, 10, -1);
porsh4:addPorsh(porshSpr, 0, 41, 30);

porsh4:getRoot():SetPos(0, cylY, -1);
porsh4:getRoot():SetZDepth(-7);
mission:addAnimationNode(porsh4, rdIdx)


-- створки окон

local openCloseTime = 0.3;

local wnd = MusCircleWnd(coreRoot, openCloseTime)
local leaf1 = KrSprite(boxVault:GetSpriteResource("win_shtor1"))
wnd:addLeaf(leaf1, 0.3927 * 2, -0.7854 - 0.3927 * 2);
local leaf2 = KrSprite(boxVault:GetSpriteResource("win_shtor1"))
wnd:addLeaf(leaf2, 0.3927, -0.7854 - 0.3927);
local leaf3 = KrSprite(boxVault:GetSpriteResource("win_shtor1"))
wnd:addLeaf(leaf3, 0, -0.7854);

wnd:getRoot():SetPos(211, 206, -1);
wnd:getRoot():SetZDepth(-11);
mission:addAnimationNode(wnd, luIdx)


local wnd = MusCircleWnd(coreRoot, openCloseTime)
local leaf1 = KrSprite(boxVault:GetSpriteResource("win_shtor2"))
wnd:addLeaf(leaf1, -0.3927 * 2, 0.7854 + 0.3927 * 2);
local leaf2 = KrSprite(boxVault:GetSpriteResource("win_shtor2"))
wnd:addLeaf(leaf2, -0.3927, 0.7854 + 0.3927);
local leaf3 = KrSprite(boxVault:GetSpriteResource("win_shtor2"))
wnd:addLeaf(leaf3, 0, 0.7854);

wnd:getRoot():SetPos(806, 203, -1);
wnd:getRoot():SetZDepth(-11);
mission:addAnimationNode(wnd, ruIdx)


local wnd = MusCircleWnd(coreRoot, openCloseTime)
local leaf1 = KrSprite(boxVault:GetSpriteResource("win_shtor3"))
wnd:addLeaf(leaf1, -0.3927 * 2, 0.7854 + 0.3927 * 2);
local leaf2 = KrSprite(boxVault:GetSpriteResource("win_shtor3"))
wnd:addLeaf(leaf2, -0.3927, 0.7854 + 0.3927);
local leaf3 = KrSprite(boxVault:GetSpriteResource("win_shtor3"))
wnd:addLeaf(leaf3, 0, 0.7854);

wnd:getRoot():SetPos(212, 563, -1);
wnd:getRoot():SetZDepth(-11);
mission:addAnimationNode(wnd, ldIdx)

local wnd = MusCircleWnd(coreRoot, openCloseTime)
local leaf1 = KrSprite(boxVault:GetSpriteResource("win_shtor4"))
wnd:addLeaf(leaf1, 0.3927 * 2, -0.7854 - 0.3927 * 2);
local leaf2 = KrSprite(boxVault:GetSpriteResource("win_shtor4"))
wnd:addLeaf(leaf2, 0.3927, -0.7854 - 0.3927);
local leaf3 = KrSprite(boxVault:GetSpriteResource("win_shtor4"))
wnd:addLeaf(leaf3, 0, -0.7854);

wnd:getRoot():SetPos(811, 568, -1);
wnd:getRoot():SetZDepth(-11);
mission:addAnimationNode(wnd, rdIdx)


-- бэки окон

local wndbg = KrSprite(boxVault:GetSpriteResource("win_back_1"))
wndbg:SetPos(211, 206, -1);
wndbg:SetZDepth(-13);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("win_back_2"))
wndbg:SetPos(806, 203, -1);
wndbg:SetZDepth(-13);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("win_back_3"))
wndbg:SetPos(212, 563, -1);
wndbg:SetZDepth(-13);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("win_back_4"))
wndbg:SetPos(811, 568, -1);
wndbg:SetZDepth(-13);
addNodeAdopt(wndbg, coreRoot)


-- тени окон

wndbg = KrSprite(boxVault:GetSpriteResource("win_shad_1"))
wndbg:SetPos(211, 206, -1);
wndbg:SetZDepth(-12);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("win_shad_2"))
wndbg:SetPos(806, 203, -1);
wndbg:SetZDepth(-12);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("win_shad_3"))
wndbg:SetPos(212, 563, -1);
wndbg:SetZDepth(-12);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("win_shad_4"))
wndbg:SetPos(811, 568, -1);
wndbg:SetZDepth(-12);
addNodeAdopt(wndbg, coreRoot)


-- мастер бар

wndbg = KrSprite(boxVault:GetSpriteResource("master_rmk2"))
wndbg:SetPos(511, 629, -1);
wndbg:SetZDepth(-17);
addNodeAdopt(wndbg, coreRoot)

wndbg = KrSprite(boxVault:GetSpriteResource("master_back"))
wndbg:SetPos(511, 629, -1);
wndbg:SetZDepth(-19);
addNodeAdopt(wndbg, coreRoot)



local barSpeed = 0.1963495408;
local disk;
local diskSpr;
local disksXL = 511 + 6;
local disksXR = 511 - 6;
local disksY = 631 + 4 - 6;
local scaleBar = 0.84;

--[[
	disk = Disk(coreRoot, 0.39269908169, -barSpeed);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_4"))
	setNodeScale(disk:getRoot(), scaleBar, scaleBar);
	disk:getRoot():SetPos(disksXL, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 4)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_4"))
	setNodeScale(disk:getRoot(), scaleBar, scaleBar);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(disksXR, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 11)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 1.5);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_3"))
	setNodeScale(disk:getRoot(), scaleBar, scaleBar);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(disksXL, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 5)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 1.5);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_3"))
	setNodeScale(disk:getRoot(), scaleBar, scaleBar);
	disk:getRoot():SetPos(disksXR, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 10)
]]--

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 1.5);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_3"))
	setNodeScale(disk:getRoot(), scaleBar, scaleBar);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(disksXL, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 4)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 2);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_2"))
	setNodeScale(diskSpr, scaleBar, scaleBar);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(disksXL, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 5)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 4);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_1"))
	setNodeScale(diskSpr, scaleBar, scaleBar);
	disk:getRoot():SetPos(disksXL, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 6)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 1.5);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_3"))
	setNodeScale(disk:getRoot(), scaleBar, scaleBar);
	disk:getRoot():SetPos(disksXR, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 9)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 2);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_2"))
	setNodeScale(diskSpr, scaleBar, scaleBar);
	disk:getRoot():SetPos(disksXR, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 8)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 4);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_1"))
	setNodeScale(diskSpr, scaleBar, scaleBar);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(disksXR, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 7)





--[[
local barSpeed = 0.1963495408;
local disk;
local diskSpr;
local disksY = 631 + 6;

local scaleBar = 0.84;

	disk = Disk(coreRoot, 0.39269908169, -barSpeed);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_4"))
--	setNodeScale(disk:getRoot(), scaleBar, 1);
	disk:getRoot():SetPos(511 + 58, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 4)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_4"))
--	setNodeScale(diskSpr, scaleBar, 1);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(511 - 58, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 11)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 1.5);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_3"))
--	setNodeScale(diskSpr, scaleBar, 1);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(511 + 44, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 5)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 1.5);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_3"))
--	setNodeScale(diskSpr, scaleBar, 1);
	disk:getRoot():SetPos(511 - 44, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 10)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 2);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_2"))
--	setNodeScale(diskSpr, scaleBar, 1);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(511 + 29, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 6)

	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 2);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_r_2"))
--	setNodeScale(diskSpr, scaleBar, 1);
	disk:getRoot():SetPos(511 - 29, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 9)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 4);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_1"))
--	setNodeScale(diskSpr, scaleBar, 1);
	disk:getRoot():SetPos(511 + 5 + 9, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, false);
	mission:addAnimationNode(disk, 7)


	disk = Disk(coreRoot, 0.39269908169, -barSpeed * 4);
	diskSpr = KrSprite(boxVault:GetSpriteResource("disk_l_1"))
--	setNodeScale(diskSpr, scaleBar, 1);
	diskSpr:SetAction("r");
	disk:getRoot():SetPos(511 - 5 - 9, disksY, -1);
	disk:getRoot():SetZDepth(-19);
	disk:setSprite(diskSpr, 0.196349540849, true);
	mission:addAnimationNode(disk, 8)
]]--

mission:setBG(spr)
mission:createHoleForMasterBar(221, 594, 580, 88);

	local button = XButton();


	local x = 68
	local y = 18

	local width = 94
	local height = 30
	local sensX = -47
	local sensY = -15
	local textY = sensY + 3;

	local rText = 245;
	local gText = 203;
	local bText = 99;
	local aText = 216;

	local rHText = 255;
	local gHText = 255;
	local bHText = 255;
	local aHText = 216;
		
	initXBtn(button, "Btn_game", x, y, sensX, sensY, width, height, vault)
	initXButtonText(button, "GAME_SCREEN.HINT",
						sensX, textY, 
						width, height, 
						"occ24bg", KrTextBox.CENTER)

	button:setTextColor(rText, gText, bText, aText);
	button:setTextColorBType(XButton.NORMAL_HIGHLIGHTED, rHText, gHText, bHText, aHText);
	button:setTextColorBType(XButton.NORMAL_PRESSED, rHText, gHText, bHText, aHText);

	mission:setHelpButton(button)

	button = XButton();

	x = x + 1024 - 68 - 68

	initXBtn(button, "Btn_game", x, y, sensX, sensY, width, height, vault)
	initXButtonText(button, "GAME_SCREEN.MENU",
						sensX, textY, 
						width, height, 
						"occ24bg", KrTextBox.CENTER)

	button:setTextColor(rText, gText, bText, aText);
	button:setTextColorBType(XButton.NORMAL_HIGHLIGHTED, rHText, gHText, bHText, aHText);
	button:setTextColorBType(XButton.NORMAL_PRESSED, rHText, gHText, bHText, aHText);

	mission:setExitButton(button)

fadingPlane = KrSprite(vault:GetSpriteResource("fadingPlane"))
fadingPlane:SetPos(0, 0, -1)
mission:setFadingPlaneSprite(fadingPlane)
