Fixed multiplayer
This commit is contained in:
parent
59b353741f
commit
5276377393
@ -124,6 +124,8 @@ io.on('connection', socket => {
|
|||||||
|
|
||||||
socket.on('card finished', function (difficulty) {
|
socket.on('card finished', function (difficulty) {
|
||||||
gameState['positions'][gameState['players'].indexOf(socket.username)] += 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');
|
io.in(socket.room).emit('card destroyed');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -169,6 +169,8 @@ function start_game() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('card destroyed', function () {
|
socket.on('card destroyed', function () {
|
||||||
|
diced = false;
|
||||||
|
show_card = false;
|
||||||
card.destroyCard();
|
card.destroyCard();
|
||||||
rolled_number_text.destroy();
|
rolled_number_text.destroy();
|
||||||
border_card_stack.clear();
|
border_card_stack.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user