Removal = getClass("Removal")

Removal.minigameID = "REMOVAL"
Removal.minigameIdx = 5

Removal.levels = {}
Removal.levels[1] =
{
	duration = 30000,
	borderPenalty=100,
}
Removal.levels[2] =
{
	duration = 30000,
	borderPenalty=100,
}
Removal.levels[3] =
{
	duration = 30000,
	borderPenalty=100,
}
Removal.levels[4] =
{
	duration = 30000,
	borderPenalty=100,
}
Removal.levels[5] =
{
	duration = 35000,
	borderPenalty=1000,
}
Removal.layouts = {}
Removal.layouts[1] =
{	class="Removal",
	name="Removal MiniGame",
	colorValues = {160, 170, 180, 190, 200, 210},
	versions=
	{
		{
			background="REMOVAL_1_BACKGROUND:minigames",
			mask="REMOVAL_1_MASK:minigames",
			exit={class="Sprite", image="REMOVAL_1_EXIT:minigames", x=478, y=119},
			exitPos={x=654, y=268},
			marble={"REMOVAL_OBJECT5:minigames", "REMOVAL_OBJECT1:minigames", "REMOVAL_OBJECT2:minigames", "REMOVAL_OBJECT3:minigames", "REMOVAL_OBJECT4:minigames", },
			gates={
				{class="GateObject", name="1", image="REMOVAL_CP1:minigames", x=555, y=269, marblePos={x=338, y=307}, anchor="center", },
				{class="GateObject", name="2", image="REMOVAL_1_CP2:minigames", x=305, y=298, marblePos={x=157, y=258}, anchor="center", },
				{class="GateObject", name="3", image="REMOVAL_1_CP3:minigames", x=216, y=333, marblePos={x=58, y=474}, anchor="center", },
				{class="GateObject", name="4", image="REMOVAL_1_CP4:minigames", x=95, y=463, marblePos={x=232, y=577}, anchor="center", },
				{class="GateObject", name="5", image="REMOVAL_1_CP5:minigames", x=185, y=553, marblePos={x=61, y=597}, anchor="center", },
			},
			objects={
				{class="SpriteExt", name="o1", baseAnimation="REMOVAL_OBSTACLE1", defaultSection="minigames", x=110, y=284, hitmask="REMOVAL_OBSTACLE1_MASK:minigames", pingPong=true, },
			},
		},
		{
			background="REMOVAL_2_BACKGROUND:minigames",
			mask="REMOVAL_2_MASK:minigames",
			exit={class="Sprite", image="REMOVAL_2_EXIT:minigames", x=492, y=430},
			exitPos={x=633, y=545},
			marble={"REMOVAL_OBJECT5:minigames", "REMOVAL_OBJECT1:minigames", "REMOVAL_OBJECT2:minigames", "REMOVAL_OBJECT3:minigames", "REMOVAL_OBJECT4:minigames", },
			gates={
				{class="GateObject", name="1", image="REMOVAL_CP1:minigames", x=382, y=535, marblePos={x=416, y=544}, anchor="center", },
				{class="GateObject", name="2", image="REMOVAL_2_CP2:minigames", x=382, y=535, marblePos={x=376, y=332}, anchor="center", },
				{class="GateObject", name="3", image="REMOVAL_2_CP3:minigames", x=311, y=207, marblePos={x=65, y=376}, anchor="center", },
				{class="GateObject", name="4", image="REMOVAL_2_CP4:minigames", x=108, y=337, marblePos={x=193, y=511}, anchor="center", },
				{class="GateObject", name="5", image="REMOVAL_2_CP5:minigames", x=139, y=478, marblePos={x=164, y=595}, anchor="center", },
			},
			objects={
				{class="SpriteExt", name="o1", baseAnimation="REMOVAL_OBSTACLE1", defaultSection="minigames", x=144, y=153, hitmask="REMOVAL_OBSTACLE1_MASK:minigames", pingPong=true, },
			},
		},
		{
			background="REMOVAL_3_BACKGROUND:minigames",
			mask="REMOVAL_3_MASK:minigames",
			exit={class="Sprite", image="REMOVAL_3_EXIT:minigames", x=458, y=239},
			exitPos={x=586, y=343},
			marble={"REMOVAL_OBJECT5:minigames", "REMOVAL_OBJECT1:minigames", "REMOVAL_OBJECT2:minigames", "REMOVAL_OBJECT3:minigames", "REMOVAL_OBJECT4:minigames", },
			gates={
				{class="GateObject", name="1", image="REMOVAL_CP1:minigames", x=477, y=310, marblePos={x=286, y=333}, anchor="center", },
				{class="GateObject", name="2", image="REMOVAL_3_CP2:minigames", x=305, y=251, marblePos={x=150, y=207}, anchor="center", },
				{class="GateObject", name="3", image="REMOVAL_3_CP3:minigames", x=100, y=186, marblePos={x=72, y=381}, anchor="center", },
				{class="GateObject", name="4", image="REMOVAL_3_CP4:minigames", x=112, y=370, marblePos={x=118, y=567}, anchor="center", },
				{class="GateObject", name="5", image="REMOVAL_3_CP5:minigames", x=113, y=563, marblePos={x=146, y=481}, anchor="center", },
			},
			objects={
				{class="SpriteExt", name="o1", baseAnimation="REMOVAL_OBSTACLE1", defaultSection="minigames", x=154, y=126, hitmask="REMOVAL_OBSTACLE1_MASK:minigames", pingPong=true, },
			},
		},
	},
}

GateObject = deriveLuaClass("GateObject", "Sprite")
function GateObject:init(desc)
	self.marblePos = desc.marblePos
	self.ox = desc.x
	self.oy = desc.y
end

function GateObject:reset()
	self:setLocation(self.ox, self.oy)
end
