summaryrefslogtreecommitdiff
path: root/Penguloon/Levels
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-02 23:36:55 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-02 23:36:55 +0100
commita05ae287aa87259817e6ca7627986e14eeab6098 (patch)
tree18578b24ab1c35aec05c465fbdc0af517b716fed /Penguloon/Levels
parent0c58f5048e37ad40c68f56f3dc7756d60816cc0e (diff)
dank
Diffstat (limited to 'Penguloon/Levels')
-rw-r--r--Penguloon/Levels/IceLevel3.cs2
-rw-r--r--Penguloon/Levels/Map.cs53
2 files changed, 42 insertions, 13 deletions
diff --git a/Penguloon/Levels/IceLevel3.cs b/Penguloon/Levels/IceLevel3.cs
index e70ea70..f7a46e4 100644
--- a/Penguloon/Levels/IceLevel3.cs
+++ b/Penguloon/Levels/IceLevel3.cs
@@ -14,7 +14,7 @@ namespace Penguloon.Levels
this.Money = 123550;
this.Health = 200;
this.ID = 3;
- this.MinimumLevel = 5;
+ this.MinimumLevel = 10;
LevelType = LevelType.Ice;
}
diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs
index 03e1c4f..806c8de 100644
--- a/Penguloon/Levels/Map.cs
+++ b/Penguloon/Levels/Map.cs
@@ -65,6 +65,25 @@ namespace Penguloon.Levels
public void Draw(float deltaTime)
{
+ DrawMap();
+
+ DrawSpareTiles();
+
+ for (int i = 0; i < Enemies.Count; i++)
+ {
+ if (Enemies[i].Texture != null)
+ ParentScene.Main.SpriteBatch.Draw(Enemies[i].Texture,
+ destinationRectangle: Enemies[i].Box);
+ }
+
+ for (int i = 0; i < Objects.Count; i++)
+ {
+ Objects[i].Draw(deltaTime);
+ }
+ }
+
+ private void DrawMap()
+ {
for (int y = 0; y < TileMap.GetLength(0); y++)
{
for (int x = 0; x < TileMap.GetLength(1); x++)
@@ -77,16 +96,19 @@ namespace Penguloon.Levels
case LevelType.Sand: tileTexture = ContentManager.GetSandTileTextureByType(TileMap[y, x].Type); break;
}
- if(tileTexture != null)
- ParentScene.Main.SpriteBatch.Draw(tileTexture,
- destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight));
+ if (tileTexture != null)
+ ParentScene.Main.SpriteBatch.Draw(tileTexture,
+ destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight));
//if (ParentScene.ObjectSeletor.State == Controls.State.Selected)
// ParentScene.Main.SpriteBatch.Draw(tileTexture,
// destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight));
}
}
+ }
+ private void DrawSpareTiles()
+ {
Texture2D tileTextureSpare = null;
Texture2D unplaceableTileTexture = null;
@@ -113,17 +135,19 @@ 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);
- }
-
for (int i = 0; i < Objects.Count; i++)
{
- Objects[i].Draw(deltaTime);
+ if (ParentScene.ObjectSeletor.State != Controls.State.Selected) continue;
+
+ for (int x = 0; x < Objects[i].TileSpanX; x++)
+ {
+ for (int y = 0; y < Objects[i].TileSpanY; y++)
+ {
+ ParentScene.Main.SpriteBatch.Draw(unplaceableTileTexture,
+ destinationRectangle: new Rectangle((int)Objects[i].Position.X + (x * TileWidth),
+ (int)Objects[i].Position.Y + (y * TileHeight), TileWidth, TileHeight));
+ }
+ }
}
}
@@ -235,6 +259,11 @@ namespace Penguloon.Levels
var b = new HealthGeneratorObject(pos, this);
Objects.Add(b);
}
+ if (type == typeof(MortarObject))
+ {
+ var b = new MortarObject(pos, this);
+ Objects.Add(b);
+ }
}
}