Exemple #1
0
 public void goOutFromBase(PathPointer[] currentPathPointers)
 {
     isOutBase                 = true;
     transform.position        = currentPathPointers[0].transform.position; // ustawienie początkowe pionka
     current_moveNumberofSteps = 1;
     c_pathPointer             = currentPathPointers[0];                    //Jak wyjdę z bazy to aktualny i poprzedni pionek są tymi samymi
     p_pathPointer             = currentPathPointers[0];
     GameManager.gm.AddPlayerToBoardPoint(c_pathPointer);
     //
     GameManager.gm.aktualny_pionek = this.id_pionek;
     c_pathPointer.AddPoint(this);
     c_pathPointer.AdjustPlayersToPathPointer();
 }
Exemple #2
0
    public IEnumerator MoveStepsEnum(PathPointer[] currentPathPointers)
    {
        yield return(new WaitForSeconds(0.2f));

        int gmStepsToMove = GameManager.gm.stepsToMove;

        if (canMove)
        {
            if (isPossibleToMove(gmStepsToMove, current_moveNumberofSteps, currentPathPointers))
            {
                GameManager.gm.aktualny_pionek = this.id_pionek;

                for (int i = current_moveNumberofSteps; i < current_moveNumberofSteps + gmStepsToMove; ++i)
                {
                    transform.position = currentPathPointers[i].transform.position;
                    yield return(new WaitForSeconds(0.2f));
                }


                current_moveNumberofSteps += gmStepsToMove; // aktualnie przebyta odleglosc na planszy

                GameManager.gm.RemovePlayerFromBoardPoint(p_pathPointer);
                p_pathPointer.RemovePoint(this);

                c_pathPointer = currentPathPointers[current_moveNumberofSteps - 1];
                c_pathPointer.AddPoint(this);
                GameManager.gm.AddPlayerToBoardPoint(c_pathPointer);
                p_pathPointer = c_pathPointer;
                c_pathPointer.bitUpPawn();
                GameManager.gm.stepsToMove = 0;
            }
        }
        if (move_Coroutine != null)
        {
            StopCoroutine(move_Coroutine);
        }
    }