Fixed multiplayer

This commit is contained in:
2021-06-14 12:29:38 +02:00
parent 59b353741f
commit 5276377393
2 changed files with 4 additions and 0 deletions

View File

@@ -124,6 +124,8 @@ io.on('connection', socket => {
socket.on('card finished', function (difficulty) {
gameState['positions'][gameState['players'].indexOf(socket.username)] += difficulty;
gameState['whosNext'] += 1;
if(gameState['whosNext'] === gameState['players'].length) gameState['whosNext'] = 0;
io.in(socket.room).emit('card destroyed');
});
});