Exemplo n.º 1
0
        private static void SellTower(Vector2D point)
        {
            var level = (GameLevel)Level.Current;

            if (level == null)
            {
                return;
            }
            level.SellTower(GameLevelExtensions.GetGridPosition(point));
        }
Exemplo n.º 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();
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
 private static bool IsSpecialAttackPossible(Vector2D pos)
 {
     return(Player.Current.Avatar.SpecialAttackAIsActivated ||
            Player.Current.Avatar.SpecialAttackBIsActivated &&
            Level.Current.IsInsideLevelGrid(GameLevelExtensions.GetGridPosition(pos)));
 }
Exemplo n.º 5
0
 public Vector2D GetRealPosition(Vector2D point)
 {
     //return GameLevelExtensions.GetGridPosition(point) + Vector2D.Half;
     return(GetWorldCoordinates(GameLevelExtensions.GetGridPosition(point)));
 }