Fix win/over in local

This commit is contained in:
Tim Petricola
2014-03-10 17:18:54 -04:00
parent 664546ef9a
commit fda0e8405f
+4 -2
View File
@@ -118,9 +118,11 @@ HTMLActuator.prototype.updateBestScore = function (bestScore) {
HTMLActuator.prototype.message = function (won) {
var type = won ? "game-won" : "game-over";
var message = won ? "You win!" : "Game over!"
var message = won ? "You win!" : "Game over!";
if (ga) ga("send", "event", "game", "end", type, this.score);
if (typeof ga !== "undefined") {
ga("send", "event", "game", "end", type, this.score);
}
this.messageContainer.classList.add(type);
this.messageContainer.getElementsByTagName("p")[0].textContent = message;