From d63461b58f30035483e55a151026ed9c52ca462d Mon Sep 17 00:00:00 2001 From: Mohamad Date: Tue, 17 Oct 2023 10:31:41 +1000 Subject: [PATCH] Added Shake screen effect at every wave --- .../game/components/maingame/UIElementsDisplay.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 ecf3c9758..b18130489 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 @@ -21,6 +21,7 @@ public class UIElementsDisplay extends UIComponent { private final Table buttonTable = new Table(); private TextButton remainingMobsButton; private TextButton timerButton; + long time = 0; @Override public void create() { @@ -98,7 +99,14 @@ public void updateTimerButton() { createTimerButton(); } timerButton.setText("Next wave in: " + finalTime); + time = ServiceLocator.getTimeSource().getTime(); } else { + if (ServiceLocator.getTimeSource().getTime() < time + 2000) { + ServiceLocator.getMapService().shakeCameraMap(); + ServiceLocator.getMapService().shakeCameraGrid(); + } +// ServiceLocator.getMapService().shakeCameraMap(); +// ServiceLocator.getMapService().shakeCameraGrid(); remainingMobsButton.setDisabled(true); timerButton.addAction(new SequenceAction(Actions.fadeOut(1f), Actions.removeActor())); stage.act();