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

Sprint 4 - Team 4: Take players to losing screen if timer runs out #218

Open
1 task done
riotanabe opened this issue Oct 18, 2022 · 3 comments
Open
1 task done
Labels
communication additional communication between teams task New task as part of implementing a feature Team 3 Team 4 Sprint 4: Improve Countdown Clock and Bug Fix

Comments

@riotanabe
Copy link
Contributor

riotanabe commented Oct 18, 2022

Description

Task: Take players to losing screen if timer runs out.
Feature: Countdown Clock (#3 )

Players should be taken to the losing screen made by Team 3, when the countdown timer runs out which indicates the player has lost the game. Discussion should be made with team 3 to understand how we can access their methods and successfully change the screen.

Dependencies

Completion Deadline: Oct. 18

Member

@riotanabe riotanabe added task New task as part of implementing a feature Team 3 Team 4 Sprint 4: Improve Countdown Clock and Bug Fix communication additional communication between teams labels Oct 18, 2022
@riotanabe
Copy link
Contributor Author

riotanabe commented Oct 18, 2022

Instructions from Team 3 on discord [13/10]:

Screen Shot 2022-10-18 at 16 42 49

Screen Shot 2022-10-18 at 16 42 36

"
first you need to import the package: 'import com.deco2800.game.components.endingmenu.EndingMenuDisplay;'
then call the setlose function: 'EndingMenuDisplay.setLose();'
finally set the screen: 'entity.getEvents().trigger("ending");'
"

@riotanabe
Copy link
Contributor Author

riotanabe commented Oct 18, 2022

Tried this exact method in our update method in countdownDisplay.java:

`
if (this.timeRemaining <= 0) {
counterLabel.setText("GAME OVER!");

        game.theGameScreen.changeStatus();
        EndingMenuDisplay.setLose();
        entity.getEvents().trigger("ending");
    }

`

But this caused the game to break when the timer runs out.

@riotanabe
Copy link
Contributor Author

Solution by @jeffjeffUQ :

  • changing the screen from MainGameScreen to the losing screen instead of from within the countdownClockDisplay update method.

Screen Shot 2022-10-18 at 14 14 29

timeTime is a boolean value of whether there is time remaining or not.
When timeTime is false i.e., time has run out, the "judge" variable in EndingMenuDisplay will be setLose() as per team 3's instruction, the will switch screens in to GdxGame.ScreenType.ENDING.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
communication additional communication between teams task New task as part of implementing a feature Team 3 Team 4 Sprint 4: Improve Countdown Clock and Bug Fix
Projects
None yet
Development

No branches or pull requests

1 participant