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

[Team 4] Incorrect end of game trigger issue #299

Merged
merged 1 commit 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 @@ -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");
Expand All @@ -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) {
Expand Down
Loading