private static void SellTower(Vector2D point)
        {
            var level = (GameLevel)Level.Current;

            if (level == null)
            {
                return;
            }
            level.SellTower(GameLevelExtensions.GetGridPosition(point));
        }
        public void Display(Vector2D screenPos)
        {
            var currentGameLevel = (GameLevel)Level.Current;

            if (currentGameLevel == null || currentGameLevel.IsCompleted)
            {
                return;
            }
            var gridPos = GameLevelExtensions.GetGridPosition(screenPos);

            if (!currentGameLevel.IsInsideLevelGrid(gridPos))
            {
                return;
            }
            if (!currentGameLevel.IsTileInteractable(gridPos))
            {
                DisplayCrossBillboard();
                return;
            }

            clickedPosition = gridPos;
            MoveSceneToClickedPosition(screenPos);
            Show();
        }
예제 #3
0
 private static bool IsSpecialAttackPossible(Vector2D pos)
 {
     return(Player.Current.Avatar.SpecialAttackAIsActivated ||
            Player.Current.Avatar.SpecialAttackBIsActivated &&
            Level.Current.IsInsideLevelGrid(GameLevelExtensions.GetGridPosition(pos)));
 }