From dd8da33e997b4ff8320edc544158b598eadd11ae Mon Sep 17 00:00:00 2001 From: Andrei Gavra Date: Mon, 5 Aug 2019 21:50:53 +0300 Subject: [PATCH] Fix enemy spawn position --- Assets/Scripts/src/Level/LevelManager.cs | 6 +++++- Assets/TextMesh Pro.meta | 8 -------- ProjectSettings/ProjectVersion.txt | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 Assets/TextMesh Pro.meta diff --git a/Assets/Scripts/src/Level/LevelManager.cs b/Assets/Scripts/src/Level/LevelManager.cs index dfbc436..48cf65f 100644 --- a/Assets/Scripts/src/Level/LevelManager.cs +++ b/Assets/Scripts/src/Level/LevelManager.cs @@ -12,6 +12,10 @@ namespace src.Level { public class LevelManager : GameplayComponent, IDynamicLevelData { + /** Extracted them here for easy to change reason */ + private const int XMinEnemyPosition = 5; + private const int YMinEnemyPosition = -5; + public Count DestructibleWallCount { get => _destructibleWallCount; @@ -204,13 +208,13 @@ namespace src.Level var numberOfEnemiesToPlace = _enemyCount.RandomIntRange(); _freeGridPositions.ShuffleList(); + _freeGridPositions.RemoveAll(pos => pos.x <= XMinEnemyPosition && pos.y >= YMinEnemyPosition); foreach (var nextPosition in _freeGridPositions) { if (numberOfEnemiesToPlace == 0) { break; } - PlaceEnemy(nextPosition); numberOfEnemiesToPlace -= 1; } diff --git a/Assets/TextMesh Pro.meta b/Assets/TextMesh Pro.meta deleted file mode 100644 index f9da8b5..0000000 --- a/Assets/TextMesh Pro.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f54d1bd14bd3ca042bd867b519fee8cc -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index c19a8ba..90c2f6e 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.4.3f1 +m_EditorVersion: 2018.4.5f1