diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2017-12-14 23:35:47 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2017-12-14 23:35:47 +0100 |
| commit | a42938d1553565e3d864fa46c04401bbb6f8d13f (patch) | |
| tree | 24a24a3bd7eb01607c30e176ee0fcaf4e912a277 /Penguloon/Levels/Map.cs | |
| parent | 98fb0bdcf3fb02f68f07a72cab211debb827e978 (diff) | |
New balloons & sounds. Objects can now shoot projectiles.
Diffstat (limited to 'Penguloon/Levels/Map.cs')
| -rw-r--r-- | Penguloon/Levels/Map.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs index 0e3dde6..05d1669 100644 --- a/Penguloon/Levels/Map.cs +++ b/Penguloon/Levels/Map.cs @@ -94,26 +94,33 @@ namespace Penguloon.Levels if(Enemies.Count == 0 && WaveManager.DoneSpawning && WaveManager.RoundActive) { WaveManager.RoundActive = false; + Level.Money += (WaveManager.CurrentWave * 11); } } - public void SpawnEnemy(Type childObject, Vector2 position, Vector2 targetPosition) + public void SpawnEnemy(Type childObject, Vector2 position, Vector2 targetPosition, int index) { - AddEnemyToList(position, targetPosition, childObject); + AddEnemyToList(position, targetPosition, childObject, 0); } public void SpawnEnemy(Type childObject) { - AddEnemyToList(SpawnPoint, SpawnPointTargetPos, childObject); + AddEnemyToList(SpawnPoint, SpawnPointTargetPos, childObject, 0); } - private void AddEnemyToList(Vector2 pos, Vector2 target, Type type) + private void AddEnemyToList(Vector2 pos, Vector2 target, Type type, int index) { if (type == typeof(RedBalloon)) { var b = new RedBalloon(this); b.Position = pos; b.TargetPosition = target; - Enemies.Insert(0, b); + Enemies.Insert(index, b); + } + if (type == typeof(BlueBalloon)) + { + var b = new BlueBalloon(this); + b.Position = pos; b.TargetPosition = target; + Enemies.Insert(index, b); } } } |
