예제 #1
0
        private static void SellTower(Vector2D point)
        {
            var level = (GameLevel)Level.Current;

            if (level == null)
            {
                return;
            }
            level.SellTower(GameLevelExtensions.GetGridPosition(point));
        }
예제 #2
0
 public void RestartTestDisplay()
 {
     pathfinding.ResetGraph();
     storedPaths.Clear();
     pathMarkers.Clear();
     GameLevelExtensions.ResetPlayerGoldAndLives();
     if (MoneyUpdated != null)
     {
         MoneyUpdated();
     }
     UpdateWave();
     UpdateLife();
     foreach (var tower in EntitiesRunner.Current.GetEntitiesOfType <Tower>())
     {
         tower.Dispose();
     }
 }
예제 #3
0
        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();
        }
예제 #4
0
 private static bool IsSpecialAttackPossible(Vector2D pos)
 {
     return(Player.Current.Avatar.SpecialAttackAIsActivated ||
            Player.Current.Avatar.SpecialAttackBIsActivated &&
            Level.Current.IsInsideLevelGrid(GameLevelExtensions.GetGridPosition(pos)));
 }
예제 #5
0
 public Vector2D GetRealPosition(Vector2D point)
 {
     //return GameLevelExtensions.GetGridPosition(point) + Vector2D.Half;
     return(GetWorldCoordinates(GameLevelExtensions.GetGridPosition(point)));
 }