diff --git a/scripts/game/game_controller.js b/scripts/game/game_controller.js index b84d373..b02c33c 100644 --- a/scripts/game/game_controller.js +++ b/scripts/game/game_controller.js @@ -1,10 +1,14 @@ angular.module('app.game') -.controller('GameController', function($scope, mySocket) { +.controller('GameController', function($scope, mySocket, $rootScope) { mySocket.then(function(socket) { console.log("?????????Socket??????????"); console.log(socket); socket.on('gameUpdated:add', function(data){ console.log(">><><><><><><><><><"); + if ($rootScope.players.length == 2) { + console.log("THERES TWO OF US"); + loadStartGameState(); + } }); socket.on('chat message', function(msg){ $('#messages').append($('
  • ').text(msg)); diff --git a/server/routes/Player.js b/server/routes/Player.js index cb0ee69..7ba9005 100644 --- a/server/routes/Player.js +++ b/server/routes/Player.js @@ -12,6 +12,8 @@ this.lastUpdate = 0; this.mapId = -1; this.points = 0; + this.ready = false; + };