Fixed multiplayer #28
@ -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');
|
||||
});
|
||||
});
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user