emit 'player moved'
This commit is contained in:
parent
be4968bb07
commit
e85e66444c
@ -138,6 +138,10 @@ io.on('connection', socket => {
|
||||
if (gameState[socket.room] !== undefined && addedUser) {
|
||||
if (answerIsCorrect) gameState[socket.room].players[gameState[socket.room].whosNext].move(difficulty);
|
||||
io.in(socket.room).emit('card destroyed');
|
||||
io.in(socket.room).emit('player moved', {
|
||||
"player": gameState[socket.room].whosNext,
|
||||
"position": gameState[socket.room].players[gameState[socket.room].whosNext].position
|
||||
});
|
||||
gameState[socket.room].finish_turn();
|
||||
}
|
||||
});
|
||||
@ -191,4 +195,4 @@ function shuffleAnswers(card) {
|
||||
function pad(width, string, padding) {
|
||||
if (string === undefined || string === null) return pad(width, " ", " ");
|
||||
return (width <= string.length) ? string : pad(width, string + padding, padding);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user