require("scripts/styles/style.lua");

FixMinigameData();

MakeState{
	type = "StateMGSandCastle",

	BlgBitmap{
		image = "common/backgrounds/bg_mainmenu",
		name = "mainmenuBG",
		center = {x = 0, y = 0},
		transformMatrix = {x =  -112, y = -84},
	},
	
	gameTime = 45000,
	initScore = 0,
	
	tutorialText = "Tutorial_SandCastle",

	dependOnCustomers = true,
	loseAllCustomersLeave = false,
	numberOfCustomers = 10,
	leavingCustomersPerPiece = 1,
	totalDistractorPieces = 100,
	
	rotationRate = 0.0,
	
	--Pieces Draw Circle
	pieceRadius = 310,
	piecesCenterX = 400,  --coordinates for sandcastle and pieces circle center
	piecesCenterY = 160,
	deadRange = 70, --in degrees
	startingAngle = -8, --in degrees
	
	-- Score
	score = 10,
	scoreLoss = 0,

	pieceTint = {
		red = 0.1,
		green = 0.1,
		blue = 0.1,
		completedRed = 1.0,
		completedGreen =  1.0,
		completedBlue = 1.0,
	},
	
	puzzles = {
		{
			id = 1,
			options = 2,
			distractors = {5, 6},
		},
		{
			id = 2,
			options = 2,
			distractors = {11, 12},
		},
		{
			id = 3,
			options = 2,
			distractors = {9, 10},
		},
		{
			id = 4,
			options = 2,
			distractors = {13, 14},
		},
		{
			id = 5,
			options = 2,
			distractors = {5, 6},
		},
		{
			id = 6,
			options = 2,
			distractors = {7, 8},
		},
		{
			id = 7,
			options = 2,
			distractors = {3, 4},
		},
		{
			id = 11,
			options = 2,
			distractors = {42, 43, 44},
		},
		{
			id = 13,
			options = 2,
			distractors = {39, 40, 41},
		},
		{
			id = 15,
			options = 2,
			distractors = {24, 25, 26},
		},
		{
			id = 17,
			options = 2,
			distractors = {27, 28, 29},
		},
		{
			id = 18,
			options = 2,
			distractors = {21, 22, 23},
		},
		{
			id = 19,
			options = 2,
			distractors = {36, 37, 38},
		},		
	},

	BlgContainer {
		name = "gameContainer",
		transformMatrix = {x =  112, y = 84},

		BlgContainer
		{
			name = "mainContainer",
			BlgBitmap{
				image="level/sandcastle/textures/common/background",
				center = {x = 0, y = 0},
			},

			BlgContainer {
				name = "pieceContainer",
				transformMatrix = { x = 0, y = 0},
				sound = kDefaultButtonSound,
			},
			
			BlgContainer {
				name = "puzzleContainer",
				--transformMatrix = { x = -200, y = -100},
				sound = kDefaultButtonSound,
			},
		},

		CreateMinigameControls();

	},
};
