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

FixMinigameData();

MakeState{
	type = "StateMGSandwich",

	BlgBitmap{
		image = "common/backgrounds/bg_mainmenu",
		name = "mainmenuBG",
		center = {x = 0, y = 0},
		transformMatrix = {x =  -112, y = -84},
	},
	
	gameTime = 45000,
	initScore = 0,
	
	tutorialText = "Tutorial_Sandwich",
	
	tutorialPath = "level/tutorial/sandwich",
	
	score = 10,
	
	disorderScore = 0,
	disorderTimeOff = 2, 			--seconds to deactivate button when ingredient is not in the right order
	
	notListedScore = 0,
	notListedTimeOff = 3,			--seconds to deactivate button when ingredient is not desired by customer
	
	beltInitVelocity = -120,		--belt initial velocity (pixels per second)
	beltMaxVelocity = 4.5,			--belt maximum velocity
	beltAccelerationFactor = 1.0,	--acceletarion factor
	
	timeBeforeHiding = 0.05, --in seconds
	
	fruitFrequency = 1.0, -- in seconds

	assets = "level/sandwich/assets.lua",

	ingredients = {
		{
			id = "Cherry",
			name = "cherry",
			texture = "level/sandwich/textures/cherry",
		},
		{
			id = "Coconut",
			name = "coconut",
			texture = "level/sandwich/textures/coconut",
		},
		{
			id = "PurpleGrape",
			name = "purplegrape",
			texture = "level/sandwich/textures/purple_grape",
		},
		{
			id = "Strawberry",
			name = "strawberry",
			texture = "level/sandwich/textures/strawberry",
		},
		{
			id = "Orange",
			name = "orange",
			texture = "level/sandwich/textures/orange",
		},
		

		-- toppings
		{
			id = "TallGlass",
			name = "tallglass",
			isTop = "true",
			texture = "level/sandwich/textures/glass_tall",
		},
		{
			id = "WideGlass",
			name = "wideglass",
			isTop = "true",
			texture = "level/sandwich/textures/glass_wide",
		},
		{
			id = "TikiGlass",
			name = "tikiglass",
			isTop = "true",
			texture = "level/sandwich/textures/glass_tiki",
		},

	},
	
	customers = {
		LadiesNightActivity = {
			"level/sandwich/textures/geek",
			"level/sandwich/textures/texas",
			"level/sandwich/textures/model",
			"level/sandwich/textures/newlywedfemale",
			"level/sandwich/textures/oldfemale",
			"level/sandwich/textures/oldmale",
			"level/sandwich/textures/japanese",
			"level/sandwich/textures/newlywedmale",
		},
		
		SportsNightActivity = {
			"level/sandwich/textures/geek",
			"level/sandwich/textures/texas",
			"level/sandwich/textures/model",
			"level/sandwich/textures/newlywedfemale",
			"level/sandwich/textures/oldfemale",
			"level/sandwich/textures/oldmale",
			"level/sandwich/textures/japanese",
			"level/sandwich/textures/newlywedmale",
		},
		
		OpenBarActivity = {
			"level/sandwich/textures/geek",
			"level/sandwich/textures/texas",
			"level/sandwich/textures/model",
			"level/sandwich/textures/newlywedfemale",
			"level/sandwich/textures/oldfemale",
			"level/sandwich/textures/oldmale",
			"level/sandwich/textures/japanese",
			"level/sandwich/textures/newlywedmale",
		},
	},

	-- IMPORTANT: The last ingredient should ALWAYS be a topping!
	sandwiches = {
		{
			0,
			4,
			5,
		},
		{
			2,
			1,
			5,
		},
		{
			3,
			2,
			5,
		},
		{
			3,
			4,
			6,
		},
		{
			2,
			3,
			6,
		},
		{
			1,
			2,
			6,
		},
		{
			0,
			3,
			7,
		},
		{
			4,
			3,
			7,
		},
		{
			1,
			4,
			7,
		},

	},


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

		BlgContainer{
			name = "mainContainer",
			BlgBitmap{
				image="level/sandwich/textures/background",
				center = {x = 0, y = 0},
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 30, y = 25},
				playAnim = "Fire1",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 128, y = 25},
				playAnim = "Fire2",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 228, y = 25},
				playAnim = "Fire3",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 328, y = 25},
				playAnim = "Fire2",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 428, y = 25},
				playAnim = "Fire1",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 528, y = 25},
				playAnim = "Fire3",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 628, y = 25},
				playAnim = "Fire2",
			},
			
			BlgBitmap{
				image="level/sandwich/textures/deco_fire",
				center = {x = 0, y = 0},
				transformMatrix = {x = 728, y = 25},
				playAnim = "Fire1",
			},

			BlgBitmap{
				image="level/sandwich/textures/counter",
				transformMatrix = {x = 0, y = 335},
				center = {x = 0, y = 0},
			},
		},
		
		CreateMinigameControls();
	},
};
