 		allowOutsideClick: false,
 	})
 
-slowWarningAlert = (title, text) ->
+
+alertGameLost = () ->
+	title = "Game Over!"
+	text = "Your game has ended.<br>" +
+			"Your score was <strong>" + game.getScore() +
+			" points</strong>." +
+			"<br><br>Thanks for playing! Answers will now be displayed."
 	swal({
 		title: title,
 		text: text,

triggerUIEndGame = () ->
	$("#answers_heading").css("display", "block")
	if !game.allDone() # user ran out of time
		slowWarningAlert("Game Over!",
			"Your game has ended.<br>" +
			"Your score was <strong>" + game.getScore() +
			" points</strong>." +
			"<br><br>Thanks for playing! Answers will now be displayed.")
	updateSidebarHard()
	loadDiagramIntoUI(game.currDiagram())


	if diagram.complete
		tempAddClass "#done_button", "button_green"
		if game.allDone()
			alertGameWon()
		else
			alertDiagramDone()
		updateSidebarHard()
	else
		tempAddClass "#done_button", "button_red"
