show starting player on first load

This commit is contained in:
Viktor Rådberg
2023-08-13 00:29:15 +02:00
parent e98ab280a4
commit aaa22d8247
5 changed files with 58 additions and 2 deletions

View File

@@ -200,8 +200,10 @@ export const createInitialPlayers = ({
}: InitialSettings): Player[] => {
const players: Player[] = [];
const availableColors = [...presetColors]; // Create a copy of the colors array
const firstPlayerIndex = Math.floor(Math.random() * numberOfPlayers);
for (let i = 0; i <= numberOfPlayers - 1; i++) {
const isStartingPlayer = i === firstPlayerIndex;
const colorIndex = Math.floor(Math.random() * availableColors.length);
const color = availableColors[colorIndex];
@@ -231,7 +233,7 @@ export const createInitialPlayers = ({
usePoison: false,
rotation,
},
isStartingPlayer: isStartingPlayer,
extraCounters: [],
commanderDamage,
};