shrink tux bounding box to make him not fail on 1 or 2 tiles heigh places, also exten...
[supertux.git] / src / scene.cpp
index a235035..429abd0 100644 (file)
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include <config.h>
+
 #include <cstdlib>
 
 #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)