X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscene.cpp;h=429abd07d934c9fa12e8e43ba3549faa56b74ad5;hb=8385faa306eca6d96ab11ed7dae293d85e9c4e4f;hp=a2350355f22889b9aa77a204826ea015c3c58e9a;hpb=4c53a552c13dbe9d587e34e3cf48e82877d09288;p=supertux.git diff --git a/src/scene.cpp b/src/scene.cpp index a2350355f..429abd07d 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -17,10 +17,13 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include + #include #include "scene.h" #include "defines.h" +#include "resources.h" PlayerStatus player_status; @@ -42,6 +45,25 @@ void PlayerStatus::reset() max_score_multiplier = 1; } +void +PlayerStatus::incLives() +{ + if(lives < MAX_LIVES) + ++lives; + SoundManager::get()->play_sound(IDToSound(SND_LIFEUP)); +} + +void +PlayerStatus::incCoins() +{ + distros++; + if(distros >= 100) { + incLives(); + distros = 0; + } + SoundManager::get()->play_sound(IDToSound(SND_DISTRO)); +} + std::string bonus_to_string(PlayerStatus::BonusType b) { switch (b)