From a42938d1553565e3d864fa46c04401bbb6f8d13f Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Thu, 14 Dec 2017 23:35:47 +0100 Subject: New balloons & sounds. Objects can now shoot projectiles. --- Penguloon/Levels/Map.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'Penguloon/Levels/Map.cs') 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); } } } -- cgit v1.2.3-70-g09d2