Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Shake screen effect at every wave #296

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
private long time = 0;

@Override
public void create() {
Expand Down Expand Up @@ -98,7 +99,12 @@ 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();
}
remainingMobsButton.setDisabled(true);
timerButton.addAction(new SequenceAction(Actions.fadeOut(1f), Actions.removeActor()));
stage.act();
Expand Down
Loading