summaryrefslogtreecommitdiff
path: root/Penguloon/Levels
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-14 23:35:47 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-14 23:35:47 +0100
commita42938d1553565e3d864fa46c04401bbb6f8d13f (patch)
tree24a24a3bd7eb01607c30e176ee0fcaf4e912a277 /Penguloon/Levels
parent98fb0bdcf3fb02f68f07a72cab211debb827e978 (diff)
New balloons & sounds. Objects can now shoot projectiles.
Diffstat (limited to 'Penguloon/Levels')
-rw-r--r--Penguloon/Levels/IceLevel.cs1
-rw-r--r--Penguloon/Levels/LevelBase.cs11
-rw-r--r--Penguloon/Levels/Map.cs17
-rw-r--r--Penguloon/Levels/WaveManager.cs3
4 files changed, 25 insertions, 7 deletions
diff --git a/Penguloon/Levels/IceLevel.cs b/Penguloon/Levels/IceLevel.cs
index 1778369..1516afe 100644
--- a/Penguloon/Levels/IceLevel.cs
+++ b/Penguloon/Levels/IceLevel.cs
@@ -66,6 +66,7 @@ namespace Penguloon.Levels
//Map.Objects.Add(new PenguinObject(new Vector2(0, 0), Map));
Map.Objects.Add(new PenguinObject(new Vector2(Map.TileWidth * 2, Map.TileHeight * 4), Map));
+ Map.Objects.Add(new PenguinObject(new Vector2(Map.TileWidth * 1, Map.TileHeight * 8), Map));
}
}
} \ No newline at end of file
diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs
index f4c45a8..5698cfa 100644
--- a/Penguloon/Levels/LevelBase.cs
+++ b/Penguloon/Levels/LevelBase.cs
@@ -14,10 +14,14 @@ namespace Penguloon.Levels
public int Health { get; set; }
- public int Money { get; set; }
+ public int Money { get; set; } = 0;
public int ID { get; set; }
+ public int Kills { get; set; } = 0;
+
+ public bool Finished { get; set; } = false;
+
public LevelBase()
{
@@ -42,6 +46,11 @@ namespace Penguloon.Levels
{
Map.Update(deltaTime);
+ if(Health <= 0)
+ {
+ Finished = true;
+ }
+
UpdateUnique(deltaTime, touchLocations);
}
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);
}
}
}
diff --git a/Penguloon/Levels/WaveManager.cs b/Penguloon/Levels/WaveManager.cs
index 1a425a1..60ba210 100644
--- a/Penguloon/Levels/WaveManager.cs
+++ b/Penguloon/Levels/WaveManager.cs
@@ -26,7 +26,8 @@ namespace Penguloon.Levels
private void CreateWaves()
{
- Waves.Add(new Wave(new List<Tuple<Type, int>>() { new Tuple<Type, int>(typeof(RedBalloon), 5) }, 500));
+ Waves.Add(new Wave(new List<Tuple<Type, int>>() { new Tuple<Type, int>(typeof(BlueBalloon), 250) }, 50));
+ Waves.Add(new Wave(new List<Tuple<Type, int>>() { new Tuple<Type, int>(typeof(RedBalloon), 10) }, 500));
}
public void StartSpawningEnemies()