Closed tannerkrewson closed 3 years ago
After some investigation, here is why I think the described issue is happening:
askIfPlayersWantToPlayAgain(playerToTakeTurnNow, playerToTakeTurnAfter);
shows the play again button when called. If both players click play again, playAgain(player1, player2)
will be called (where playerToTakeTurnNow
becomes player1
, and playerToTakeTurnAfter
becomes player2
), which will call start(player1, player2
, which will eventually start a new game off by calling this line:
nextTurn(RED, player1, player2);
Therefore, the playerToTakeTurnNow
will always be red, and will always go first. And playerToTakeTurnNow
could be either player, so their color could be switched between games. Very silly. 😜
I bet I never caught this because I always lose to the AI 😆
31c6c2153df60de6d140fcb8eaabd29bc01131e0
-@kevin-shannon