Skip to content

Commit

Permalink
start game when 2 players are in
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie committed Oct 13, 2017
1 parent 2ffc17f commit 23c23d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/game/game_controller.js
Original file line number Diff line number Diff line change
@@ -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($('<li>').text(msg));
Expand Down
2 changes: 2 additions & 0 deletions server/routes/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
this.lastUpdate = 0;
this.mapId = -1;
this.points = 0;
this.ready = false;


};

Expand Down

0 comments on commit 23c23d2

Please sign in to comment.