From 75a1cc36efe5086b9213343f6f8cd4149f97e56c Mon Sep 17 00:00:00 2001 From: Mohamad Date: Tue, 12 Sep 2023 13:19:30 +1000 Subject: [PATCH] Added the spawnDroidTower() after somebody deleted it --- .../com/csse3200/game/areas/ForestGameArea.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index 83b392814..55e0daf6e 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -199,7 +199,7 @@ public void create() { // spawnIncome(); spawnScrap(); spawnTNTTower(); -// spawnDroidTower(); + spawnDroidTower(); // spawnGapScanners(); // bossKing1 = spawnBossKing1(); // bossKing2 = spawnBossKing2(); @@ -567,6 +567,17 @@ private void spawnTNTTower() { } } + + private void spawnDroidTower() { + GridPoint2 minPos = new GridPoint2(0, 0); + GridPoint2 maxPos = terrain.getMapBounds(0).sub(2, 2); + + for (int i = 0; i < NUM_WEAPON_TOWERS; i++) { + GridPoint2 randomPos = RandomUtils.random(minPos, maxPos); + Entity weaponTower = TowerFactory.createDroidTower(); + spawnEntityAt(weaponTower, randomPos, true, true); + } + } private void playMusic() {