Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/RebootJeff/phone-tag
Browse files Browse the repository at this point in the history
Conflicts:
	config/socket/socket.js
  • Loading branch information
Jeff Lee committed Dec 9, 2013
2 parents 2595967 + c267c1b commit 0fa31b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions config/socket/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ Player.prototype.usePowerUp = function(powerUpData) {
if (this.powerUps[powerUpData.name]){
this.powerUps[powerUpData.name]--;
this[powerUpData.name] = true;
powerUp = {powerUpName:powerUpData.name, playerName:that.name};
that.io.sockets.in(that.game).emit('powerUpUsed', powerUp);
setTimeout(function(){
that[powerUpData.name] = false;
that.io.sockets.in(that.game).emit('powerUpExpired', powerUp);
}, that.powerUpDuration);
}
};

Expand Down
6 changes: 6 additions & 0 deletions config/socket/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ module.exports = function(io){
var game = _allGames[data.gameID];
var player = game.getPlayer(data.playerName);
player.usePowerUp({powerUpID:data.powerUpID, powerUpName:data.powerUpName});
data.powerUpValue = true;
io.sockets.in(data.gameID).emit('powerUpUsed', data);
setTimeout(function(){
player[data.name] = data.powerUpValue = false;
io.sockets.in(data.gameID).emit('powerUpExpired', data);
}, player.powerUpDuration);
});

socket.on('leaveGame', function(data){
Expand Down

0 comments on commit 0fa31b4

Please sign in to comment.