diff --git a/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java b/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java index 644bedcb8..471739f95 100644 --- a/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java @@ -152,7 +152,6 @@ public void changed(ChangeEvent changeEvent, Actor actor) { */ public void updateMobCount() { remainingMobsButton.setText("Mobs:" + ServiceLocator.getWaveService().getEnemyCount()); - updateTimerButton(); } /** @@ -199,4 +198,12 @@ public void dispose() { buttonTable.clear(); towerTable.clear(); } + + public TextButton getRemainingMobsButton() { + return getRemainingMobsButton(); + } + + public TextButton getTimerButton() { + return timerButton; + } } 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 0ff767a61..332146d13 100644 --- a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java @@ -213,6 +213,7 @@ public void render(float delta) { } ServiceLocator.getWaveService().getDisplay().updateTimerButton(); + ServiceLocator.getWaveService().getDisplay().updateMobCount(); renderer.render(); } diff --git a/source/core/src/main/com/csse3200/game/services/WaveService.java b/source/core/src/main/com/csse3200/game/services/WaveService.java index a8416b11f..0e50a7fc1 100644 --- a/source/core/src/main/com/csse3200/game/services/WaveService.java +++ b/source/core/src/main/com/csse3200/game/services/WaveService.java @@ -52,7 +52,6 @@ public int getEnemyCount() { */ public void updateEnemyCount() { enemyCount -= 1; - display.updateMobCount(); logger.info("{} enemies remaining in wave", getEnemyCount()); }