Spiky, Snowball and Poison Ivy can move again
[supertux.git] / src / player_status.cpp
index 414a24d..3fe09f2 100644 (file)
@@ -1,7 +1,8 @@
 //  $Id$
 //
-//  SuperTux -  A Jump'n Run
+//  SuperTux
 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -72,17 +73,13 @@ void PlayerStatus::reset()
 }
 
 void
-PlayerStatus::incLives()
+PlayerStatus::add_coins(int count)
 {
-  player_status->coins = std::min(player_status->coins+100, MAX_COINS);
-  sound_manager->play("sounds/lifeup.wav");
-}
-
-void
-PlayerStatus::incCoins()
-{
-  coins++;
-  sound_manager->play("sounds/coin.wav");
+  coins = std::min(coins + count, MAX_COINS);
+  if(count > 100)
+    sound_manager->play("sounds/lifeup.wav");
+  else
+    sound_manager->play("sounds/coin.wav");
 }
 
 void