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 26c3f3ee..30ada73c 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -22,8 +22,6 @@ public class ForestGameArea extends GameArea { private static final Logger logger = LoggerFactory.getLogger(ForestGameArea.class); private Timer waveTimer; - - private static final int NUM_WEAPON_TOWERS = 3; private static final GridPoint2 PLAYER_SPAWN = new GridPoint2(2, 4); // Temporary spawn point for testing private static final float WALL_WIDTH = 0.1f; diff --git a/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java index 7e4cb7a3..68a93d93 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/FireTowerCombatTask.java @@ -132,22 +132,6 @@ public int getPriority() { return !isTargetVisible() ? 0 : priority; } - /** - * not currently used. - * @return the priority for this task - */ - public int getActivePriority() { - return !isTargetVisible() ? 0 : priority; - } - - /** - * not currently used. - * @return - */ - public int getInactivePriority() { - return isTargetVisible() ? priority : 0; - } - /** * detects targets from the centre of the tower to maxRange in a straight line. * @return true if mobs are present and false otherwise. @@ -160,15 +144,6 @@ private void changeFireRateInterval(int newInterval) { fireRateInterval = 1 / ((float) newInterval / 5); } - /** - * Function for getting the turret's fire rate. - * - * @return The fireRateInterval variable - */ - public float getFireRateInterval() { - return fireRateInterval; - } - /** * Function for getting the tower's state. * diff --git a/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java index 03abc355..d708de81 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/StunTowerCombatTask.java @@ -175,14 +175,6 @@ public int getPriority() { return !isTargetVisible() ? 0 : priority; } - public int getActivePriority() { - return !isTargetVisible() ? 0 : priority; - } - - public int getInactivePriority() { - return isTargetVisible() ? priority : 0; - } - /** * Searches for enemies/mobs in a straight line from the centre of the tower to maxRange in a straight line. * @return true if targets are detected, false otherwise @@ -195,12 +187,4 @@ private void changeFireRateInterval(int newInterval) { fireRateInterval = 1 / ((float) newInterval / 5); } - /** - * Function for getting the turret's fire rate. - * - * @return The fireRateInterval variable - */ - public float getFireRateInterval() { - return fireRateInterval; - } } diff --git a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java index 9f5f3bac..386f470d 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java @@ -34,10 +34,6 @@ * the properties stores in 'BaseTowerConfigs'. */ public class TowerFactory { - private static final Logger logger = LoggerFactory.getLogger(TowerFactory.class); - - // Define a set to keep track of occupied lanes - private static final Set occupiedLanes = new HashSet<>(); private static final int COMBAT_TASK_PRIORITY = 2; private static final int WEAPON_TOWER_MAX_RANGE = 40; private static final int TNT_TOWER_MAX_RANGE = 6; @@ -466,28 +462,4 @@ public static Entity createBaseTower() { tower.getComponent(ColliderComponent.class).setAsBoxAligned(new Vector2(1f, 1f), PhysicsComponent.AlignX.CENTER, PhysicsComponent.AlignY.CENTER); return tower; } - - public static Entity createAndPlaceTower(int lane) { - if (isLaneOccupied(lane)) { - logger.info(String.format("Lane %d is already occupied by a tower", lane)); - return null; - } - - Entity tower = createBaseTower(); - // Customize the tower creation here based on the chosen tower type - - // Add the lane to the set of occupied lanes - occupiedLanes.add(lane); - - return tower; - } - - /** - * Checks if a lane is already occupied by a tower. - * @param lane The lane to check. - * @return True if the lane is occupied, false otherwise. - */ - public static boolean isLaneOccupied(int lane) { - return occupiedLanes.contains(lane); - } } \ No newline at end of file diff --git a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java index c1c1459d..f11a4aa0 100644 --- a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java @@ -213,14 +213,11 @@ public void render(float delta) { ServiceLocator.getWaveService().getDisplay().updateMobCount(); renderer.render(); - // Check if the game has ended // Check if the game has ended if (ServiceLocator.getGameEndService().hasGameEnded()) { ui.getEvents().trigger("lose"); - } - - // Check if all waves are completed and the level has been completed - if (ServiceLocator.getWaveService().isLevelCompleted()) { + } else if (ServiceLocator.getWaveService().isLevelCompleted()) { + // Check if all waves are completed and the level has been completed if (selectedLevel == 2) { // Lava level // If it's the lava level, go to the "win" screen ui.getEvents().trigger("win"); @@ -232,7 +229,6 @@ public void render(float delta) { } } } - // Add something in to unlock the next planet/level? @Override public void resize(int width, int height) {