Exemple #1
0
    void MakeMove(GameCell targetCell)
    {
        Animator animator = GetComponentInChildren <Animator>();

        animator.SetBool("isWalk", true);
        transform.LookAt(positionConverter.ConvertBoardPositionToScene(targetCell.GetCoordinates(), true));

        iTween.MoveTo(this.gameObject, iTween.Hash(
                          "position", positionConverter.ConvertBoardPositionToScene(targetCell.GetCoordinates(), true),
                          "oncomplete", "TryMove",
                          "time", 3,
                          "easetype", "linear"));
    }
Exemple #2
0
    public void SpawnEnemies(Board board, PositionConverter positionConverter, Vector2 originPoint)
    {
        List <GameCell> freeCells = board.GetFreeCellsAtMinDistance(originPoint, minDistance);

        freeCells.Shuffle();
        for (int i = 0; i < levelConfig.monstersCount; i++)
        {
            if (i >= freeCells.Count)
            {
                break;
            }
            GameCell monsterCell     = freeCells[i];
            Vector3  monsterPosition = positionConverter.ConvertBoardPositionToScene(monsterCell.GetCoordinates(), true);
            SpawnEnemiesInPosition(monsterPosition);
        }
    }