diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2017-12-22 20:30:25 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2017-12-22 20:30:25 +0100 |
| commit | 1276593bfbbfcdbac24b48cf8b574da25945d763 (patch) | |
| tree | 3d9e8a4153b5b369184b7c7de55461bd1573d30a /Penguloon/Levels/Map.cs | |
| parent | 12c565cbb7208b44bd7654289bbac2824901f118 (diff) | |
ZULUL
Diffstat (limited to 'Penguloon/Levels/Map.cs')
| -rw-r--r-- | Penguloon/Levels/Map.cs | 35 |
1 files changed, 32 insertions, 3 deletions
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 |
