From fda0e8405fbc912241279fafda59cb03c98f4a48 Mon Sep 17 00:00:00 2001 From: Tim Petricola Date: Mon, 10 Mar 2014 17:18:54 -0400 Subject: [PATCH] Fix win/over in local --- js/html_actuator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/html_actuator.js b/js/html_actuator.js index b6aec40..3e51195 100644 --- a/js/html_actuator.js +++ b/js/html_actuator.js @@ -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; -- GitLab