Fix win/over in local
Fix win/over in local

--- a/js/html_actuator.js
+++ b/js/html_actuator.js
@@ -118,9 +118,11 @@
 
 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;

comments