- Refactoring

- Show which player is active
This commit is contained in:
2021-06-18 09:43:40 +02:00
parent f4d9804100
commit 73ced0222f
2 changed files with 70 additions and 33 deletions

View File

@@ -125,12 +125,16 @@ io.on('connection', socket => {
generate_log_message(socket.room, socket.username, "MOVE", difficulty);
}
io.in(socket.room).emit('card destroyed');
gameState[socket.room].finish_turn();
let index = gameState[socket.room].get_player_index(socket.username);
let next_player = gameState[socket.room].players[gameState[socket.room].currentPlayerIndex].name;
io.in(socket.room).emit('player moved', {
"next_player": next_player,
"player": index,
"position": gameState[socket.room].players[index].position
});
gameState[socket.room].finish_turn();
}
});
});