I am doing a Ludo Game and currently I need to check which Player got the Highest Number from the Dice and the player which has the highest number goes on the starting position.
Currently I created this method to check which player got the highest number then the player which has the highest numbers runs the method MovePlayer().
Can someone advice me on how can i correctly get the number generated for Player and the number generated for Player 2 cause currently they are the same.
public void FirstTurn(){
int player1Steps = GameObject.Find("Scripts").GetComponent<LevelManager>().randomNumberSteps;
int player2Steps = GameObject.Find("Scripts").GetComponent<LevelManager>().randomNumberSteps;
if(NetworkManager.MyGamePlayerId == "Player1" && player2Played == true)
{
if(player1Steps > player2Steps)
{
GenerateRandomNumber();
HighestRollerPlayer1 = true;
}
} else if(NetworkManager.MyGamePlayerId == "Player2" && player1Played == true)
{
if(player2Steps > player1Steps)
{
GenerateRandomNumber();
HighestRollerPlayer2 = true;
}
}
}
I am using the Photon Cloud Service since this is a multiplayer Game Thanks