private void Awake() { source = GetComponent <AudioSource>(); camAnim = Camera.main.GetComponent <Animator>(); GetGoldIncome(1); iaPlayer = GetComponent <IAPlayer>(); ObtenerTilesParaMatriz(); }
public static bool changeTurn() { if (totalTurns == (Constants.BOARD_SIZE * Constants.BOARD_SIZE) - 4) { refreshScreen(); return(false); } if (turn == Constants.W_TURN) { turn = Constants.B_TURN; } else { turn = Constants.W_TURN; } totalTurns++; List <int[]> moves = getPosibleMoves(board); int cmoves = moves.Count; if (cmoves == 0) { totalTurns--; changeTurn(); } refreshScreen(); if (turn == Constants.W_TURN) { int[] move = IAPlayer.minimaxDecision(board, turn, moves); if (makeMove(GameFlow.board, move[0], move[1], turn)) { changeTurn(); } } return(true); }