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 a "Restart from Checkpoint" button #885

Closed
wants to merge 2 commits into from

Conversation

InsightGit
Copy link
Contributor

This PR adds a "Restart from Checkpoint" button to the pause menu in order to address issue #800, which requested for this sort of button to be added. The "Restart from Checkpoint" button will only appear underneath the "Restart Level" button if the player has more than 25 coins and has passed a valid checkpoint. If the player meets the conditions and triggers the button, it will subtract 10%(or 25) of the player's coins and restart the level at the past checkpoint.

Image of "Restart from Checkpoint" button in menu

Closes #800

@tobbi
Copy link
Member

tobbi commented Jul 23, 2018

This looks good, I'll test it later today. 👍

@tobbi
Copy link
Member

tobbi commented Sep 29, 2018

Hello @InsightGit Seems like this slipped through my fingers, sorry about that. It looks good, can you just resolve the conflicts and I'll merge this.

@tobbi
Copy link
Member

tobbi commented Oct 1, 2018

There are two remaining things:

/home/travis/build/SuperTux/supertux/src/supertux/game_session.cpp: In constructor ‘GameSession::GameSession(const string&, Savegame&, Statistics*)’:
/home/travis/build/SuperTux/supertux/src/supertux/game_session.cpp:43:1: error: ‘GameSession::reset_checkpoint_button’ should be initialized in the member initialization list [-Werror=effc++]
 GameSession::GameSession(const std::string& levelfile_, Savegame& savegame, Statistics* statistics) :
 ^~~~~~~~~~~
/home/travis/build/SuperTux/supertux/src/supertux/game_session.cpp: In member function ‘virtual void GameSession::update(float)’:
/home/travis/build/SuperTux/supertux/src/supertux/game_session.cpp:410:35: error: ‘currentsector’ was not declared in this scope
     PlayerStatus *player_status = currentsector->player->get_status();
                                   ^~~~~~~~~~~~~
/home/travis/build/SuperTux/supertux/src/supertux/game_session.cpp:410:35: note: suggested alternative: ‘m_currentsector’
     PlayerStatus *player_status = currentsector->player->get_status();

} else if(reset_checkpoint_button) {
reset_checkpoint_button = false;

PlayerStatus *player_status = currentsector->player->get_status();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe get_current_sector()->player->get_status();

@tobbi
Copy link
Member

tobbi commented Jul 13, 2019

@HybridDog I don't suppose @InsightGit is interested in continuing this. Are you willing to take over?

@HybridDog
Copy link
Contributor

Yes, I'll try to add the button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Confirm Dialog for Level Restart when a Checkpoint is reached
3 participants