From 2388a02493831f3ec11f1df66a0cf7b09995279b Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sun, 2 May 2004 16:08:22 +0000 Subject: [PATCH] fixed that points aren't reset when gameover SVN-Revision: 920 --- TODO | 2 +- src/leveleditor.cpp | 1 + src/scene.cpp | 9 +++++++++ src/scene.h | 2 ++ src/title.cpp | 1 + src/worldmap.cpp | 2 +- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index be7041113..7326d4890 100644 --- a/TODO +++ b/TODO @@ -17,7 +17,6 @@ Todo a timer that is started when up is pressed, when you then land and the timer is below a certain time, you can do the jump. - when bumping a special with 2 blocks at once, it won't change direction -- points aren't reset when gameover - leveleditor lacks enemies support (will be fixed soon by Tobias) - sometimes you die after being in pause modus and unpausing - still true? @@ -26,6 +25,7 @@ Todo Fixed ----- +- points aren't reset when gameover - when jumping into the exit with a star, the endgame music will change back to levelmusic after a short time - when jupming against the 2nd multiple coin block in a level only 1 coin will diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index a77371838..dac8b287d 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -1225,6 +1225,7 @@ void le_testlevel() GameSession session("test",le_level, ST_GL_TEST); session.run(); + player_status.reset(); music_manager->halt_music(); diff --git a/src/scene.cpp b/src/scene.cpp index c75f02d63..d7034a9a0 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -32,6 +32,15 @@ PlayerStatus::PlayerStatus() { } +void PlayerStatus::reset() +{ + score = 0; + distros = 0; + lives = START_LIVES; + bonus = NO_BONUS; + score_multiplier = 1; +} + std::string bonus_to_string(PlayerStatus::BonusType b) { switch (b) diff --git a/src/scene.h b/src/scene.h index 3b60112a6..6beaeb657 100644 --- a/src/scene.h +++ b/src/scene.h @@ -37,6 +37,8 @@ struct PlayerStatus int score_multiplier; PlayerStatus(); + + void reset(); }; std::string bonus_to_string(PlayerStatus::BonusType b); diff --git a/src/title.cpp b/src/title.cpp index ec5618aeb..e758c757b 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -150,6 +150,7 @@ void check_contrib_subset_menu() std::cout << "Sarting level: " << index << std::endl; GameSession session(current_contrib_subset, index, ST_GL_PLAY); session.run(); + player_status.reset(); Menu::set_current(main_menu); } } diff --git a/src/worldmap.cpp b/src/worldmap.cpp index fbe34c9a6..cd91cb2a8 100644 --- a/src/worldmap.cpp +++ b/src/worldmap.cpp @@ -706,7 +706,7 @@ WorldMap::update(float delta) break; case GameSession::GAME_OVER: quit = true; - player_status.bonus = PlayerStatus::NO_BONUS; + player_status.reset(); break; case GameSession::NONE: // Should never be reached -- 2.11.0