--[[
	Displays a countdown for the intermission
]]

local function startCountdown()
	local gameStartingElement = activeElements.GameStartingElement

	gameStartingElement:FindFirstChild("Title").Text = translate("STARTING")

	gameStartingElement.Visible = true
	activeElements.WaitingElement.Visible = false

	local startingTick = tick()
	local timeLeft = intermissionTime - (startingTick - tick())

	while timeLeft > 0 do
		timeLeft = timeLeft - wait()

		if not gameStartingElement or not gameStartingElement.Parent then
			return
		end

		gameStartingElement.Amount.Text = math.floor(timeLeft + 0.5)
	end
end
