diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2018-01-17 14:26:43 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2018-01-17 14:26:43 +0100 |
| commit | af0ba50d00722e1b7330d1f9b1d23bd3b07a5567 (patch) | |
| tree | fbd7f63dc9bdfc4f1019c03b8f6bf7accb2dce7d /Penguloon/Levels/Map.cs | |
| parent | a9daa029db68962603905eded0e29c2a2e2abd91 (diff) | |
upgrades
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); } } |
