Fixed multiplayer

This commit is contained in:
Administrator 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');
});
});

View File

@ -169,6 +169,8 @@ function start_game() {
});
socket.on('card destroyed', function () {
diced = false;
show_card = false;
card.destroyCard();
rolled_number_text.destroy();
border_card_stack.clear();