Skip to content

Commit

Permalink
Added Shake screen effect at every wave
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamad11Dab committed Oct 17, 2023
1 parent 33cb08c commit d63461b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit d63461b

Please sign in to comment.