-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================

local function BoostSetup(callback)
	local Speedometer = gui:WaitForChild("Speedometer")
	local Bar = Speedometer:WaitForChild("Bar")
	local SpeedBar = Bar:WaitForChild("SpeedBar")
	
	BoostButton.InputBegan:Connect(function()
		callback(true)
	end)

	BoostButton.InputEnded:Connect(function()
		callback(false)
	end)

	function GuiController:UpdateBoost(boostAmount)
		local boostPercentage = math.clamp(boostAmount/engine._settings.BoostAmount, 0, 1)
		Bar.Position = UDim2.new(-1 + boostPercentage, 0, 0, 0)
		SpeedBar.Position = UDim2.new(1 - 1*boostPercentage, 0, 0, 0)
	end
end -- BoostSetup()
