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