summaryrefslogtreecommitdiff
path: root/Penguloon/Levels
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-14 16:39:16 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-14 16:39:16 +0100
commitff30178f505c69bc70b0770a3220ebd6d4706c74 (patch)
treef51c85aa9b7728af5e79c26abd9de47228d888fa /Penguloon/Levels
parent60e8e48047e774a711fee35dfc58a7be993c3d88 (diff)
dab
Diffstat (limited to 'Penguloon/Levels')
-rw-r--r--Penguloon/Levels/IceLevel.cs9
-rw-r--r--Penguloon/Levels/LevelBase.cs2
-rw-r--r--Penguloon/Levels/Map.cs23
-rw-r--r--Penguloon/Levels/WaveManager.cs2
4 files changed, 31 insertions, 5 deletions
diff --git a/Penguloon/Levels/IceLevel.cs b/Penguloon/Levels/IceLevel.cs
index 47569a8..ad34c0b 100644
--- a/Penguloon/Levels/IceLevel.cs
+++ b/Penguloon/Levels/IceLevel.cs
@@ -1,6 +1,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input.Touch;
using Penguloon.Enemies;
+using Penguloon.Objects;
using Penguloon.Scenes;
namespace Penguloon.Levels
@@ -10,6 +11,9 @@ namespace Penguloon.Levels
public IceLevel() : base()
{
this.SplashArt = ContentManager.GetTexture("SplashArt/1");
+ this.Money = 350;
+ this.Health = 200;
+ this.ID = 1;
}
public override void DrawUnique(float deltaTime)
@@ -24,7 +28,7 @@ namespace Penguloon.Levels
public override void CreateMap()
{
- Map = new Map(ParentScene);
+ Map = new Map(ParentScene, this);
Map.SpawnPoint = new Vector2(1 * Map.TileWidth, -1 * Map.TileHeight);
Map.SpawnPointTargetPos = new Vector2(1 * Map.TileWidth, 0 * Map.TileHeight);
Map.FinishPoint = new Vector2(18 * Map.TileWidth, 2 * Map.TileHeight);
@@ -59,6 +63,9 @@ namespace Penguloon.Levels
{ OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
{ OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO,OO },
};
+
+ Map.Objects.Add(new PenguinObject(new Vector2(0, 0), Map));
+ Map.Objects.Add(new PenguinObject(new Vector2(Map.TileWidth * 2, 0), Map));
}
}
} \ No newline at end of file
diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs
index 7e88cb7..f4c45a8 100644
--- a/Penguloon/Levels/LevelBase.cs
+++ b/Penguloon/Levels/LevelBase.cs
@@ -16,6 +16,8 @@ namespace Penguloon.Levels
public int Money { get; set; }
+ public int ID { get; set; }
+
public LevelBase()
{
diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs
index 19fd7c0..2ffcea0 100644
--- a/Penguloon/Levels/Map.cs
+++ b/Penguloon/Levels/Map.cs
@@ -4,6 +4,7 @@ using Penguloon.Enemies;
using Penguloon.Scenes;
using System.Collections.Generic;
using System;
+using Penguloon.Objects;
namespace Penguloon.Levels
{
@@ -21,6 +22,7 @@ namespace Penguloon.Levels
public SceneBase ParentScene { get; set; }
public List<EnemyBase> Enemies { get; set; } = new List<EnemyBase>();
+ public List<ObjectBase> Objects { get; set; } = new List<ObjectBase>();
public Vector2 SpawnPoint { get; set; }
public Vector2 SpawnPointTargetPos { get; set; }
@@ -28,9 +30,12 @@ namespace Penguloon.Levels
public WaveManager WaveManager { get; set; }
- public Map(SceneBase parentScene)
+ public LevelBase Level { get; set; }
+
+ public Map(SceneBase parentScene, LevelBase level)
{
this.ParentScene = parentScene;
+ this.Level = level;
MapWidth = (int)(StaticUIValues.ScreenViewport.X - StaticUIValues.IngameUIWidth);
MapHeight = (int)(StaticUIValues.ScreenViewport.Y);
@@ -45,7 +50,7 @@ namespace Penguloon.Levels
public void Draw(float deltaTime)
{
- for(int y = 0; y < TileMap.GetLength(0); y++)
+ for (int y = 0; y < TileMap.GetLength(0); y++)
{
for (int x = 0; x < TileMap.GetLength(1); x++)
{
@@ -60,14 +65,26 @@ namespace Penguloon.Levels
{
if (Enemies[i].Texture != null)
ParentScene.Main.SpriteBatch.Draw(Enemies[i].Texture,
- destinationRectangle: new Rectangle((int)Enemies[i].Position.X, (int)Enemies[i].Position.Y, TileWidth, TileHeight));
+ destinationRectangle: Enemies[i].Box);
+ }
+
+ for (int i = 0; i < Objects.Count; i++)
+ {
+ Objects[i].Draw(deltaTime);
}
}
public void Update(float deltaTime)
{
for (int i = 0; i < Enemies.Count; i++)
+ {
Enemies[i].Update(deltaTime);
+ }
+
+ for (int i = 0; i < Objects.Count; i++)
+ {
+ Objects[i].Update(deltaTime);
+ }
CheckIfRoundCompleted();
}
diff --git a/Penguloon/Levels/WaveManager.cs b/Penguloon/Levels/WaveManager.cs
index 1a425a1..d3d27d6 100644
--- a/Penguloon/Levels/WaveManager.cs
+++ b/Penguloon/Levels/WaveManager.cs
@@ -26,7 +26,7 @@ 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(RedBalloon), 1) }, 500));
}
public void StartSpawningEnemies()