diff options
Diffstat (limited to 'Penguloon/Levels/Map.cs')
| -rw-r--r-- | Penguloon/Levels/Map.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs index 547c0bc..362b1ba 100644 --- a/Penguloon/Levels/Map.cs +++ b/Penguloon/Levels/Map.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System; using Penguloon.Objects; using Penguloon.Controls; +using System.Linq; namespace Penguloon.Levels { @@ -71,9 +72,14 @@ namespace Penguloon.Levels for (int i = 0; i < Enemies.Count; i++) { - if (Enemies[i].Texture != null) - ParentScene.Main.SpriteBatch.Draw(Enemies[i].Texture, - destinationRectangle: Enemies[i].Box); + try + { + if (Enemies[i] != null) + if (Enemies[i].Texture != null) + ParentScene.Main.SpriteBatch.Draw(Enemies[i].Texture, + destinationRectangle: Enemies[i].Box); + } + catch { } } for (int i = 0; i < Objects.Count; i++) @@ -151,7 +157,12 @@ namespace Penguloon.Levels { for (int i = 0; i < Enemies.Count; i++) { - Enemies[i].Update(deltaTime); + try + { + if (Enemies[i] != null) + Enemies[i].Update(deltaTime); + } + catch { } } if (ParentScene.Level.Finished) return; @@ -169,7 +180,7 @@ namespace Penguloon.Levels if(Enemies.Count == 0 && WaveManager.DoneSpawning && WaveManager.RoundActive) { WaveManager.RoundActive = false; - Level.Money += (WaveManager.CurrentWave * 15); + Level.Money += (WaveManager.CurrentWave * 25); } } |
