Open
Description
Currently, the current player or current turn is held in a variable named turnIndex
, which holds the index of the current player object in the gameState.players
array. But since players can join and leave at any time, that index changes -- and not only when the turn changes! It would be more intuitive and probably more logical to store the ID of the current player, which only changes when the turn changes.
My only question is this: will this create more work for me, code-wise? (Because it's easier to access stuff in an array using an index, compared to searching for an ID within an object in that array. But I already have a helper function for that, so it probably isn't a big deal.)