From 1276593bfbbfcdbac24b48cf8b574da25945d763 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Fri, 22 Dec 2017 20:30:25 +0100 Subject: ZULUL --- Penguloon/Levels/Map.cs | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'Penguloon/Levels/Map.cs') diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs index 5248a25..2e90874 100644 --- a/Penguloon/Levels/Map.cs +++ b/Penguloon/Levels/Map.cs @@ -10,7 +10,7 @@ namespace Penguloon.Levels { public class Map { - // 18 x 12 + // 18 x 13 public Tile[,] TileMap { get; set; } public int MapWidth { get; private set; } @@ -41,9 +41,19 @@ namespace Penguloon.Levels MapHeight = (int)(StaticUIValues.ScreenViewport.Y); TileWidth = MapWidth / 18; - TileHeight = MapHeight / 13; + + if (TileWidth * 13 > MapHeight) + { + TileHeight = MapHeight / 13; + TileWidth = TileHeight; + } + else + { + TileHeight = TileWidth; + } MapWidth = TileWidth * 18; + MapHeight = TileHeight * 13; WaveManager = new WaveManager(this); } @@ -94,7 +104,7 @@ namespace Penguloon.Levels if(Enemies.Count == 0 && WaveManager.DoneSpawning && WaveManager.RoundActive) { WaveManager.RoundActive = false; - Level.Money += (WaveManager.CurrentWave * 11); + Level.Money += (WaveManager.CurrentWave * 30); } } @@ -159,6 +169,25 @@ namespace Penguloon.Levels Enemies.Insert(index, b); } } + + public void SpawnObject(Type type, Vector2 pos) + { + if (type == typeof(PenguinObject)) + { + var b = new PenguinObject(pos, this); + Objects.Add(b); + } + if (type == typeof(GoldPenguinObject)) + { + var b = new GoldPenguinObject(pos, this); + Objects.Add(b); + } + if (type == typeof(CannonObject)) + { + var b = new CannonObject(pos, this); + Objects.Add(b); + } + } } public class Tile -- cgit v1.2.3-70-g09d2