Finally!!
[supertux.git] / src / player.cpp
index 0a5de95..f95f163 100644 (file)
@@ -281,13 +281,6 @@ Player::action(double frame_ratio)
       play_current_music();
     }
 
-  /* End of level? */
-  if (base.x >= World::current()->get_level()->endpos
-      && World::current()->get_level()->endpos != 0)
-    {
-      player_status.next_level = 1;
-    }
-
   // check some timers
   skidding_timer.check();
   invincible_timer.check();
@@ -733,8 +726,8 @@ Player::collision(void* p_c_object, int c_object)
     {
     case CO_BADGUY:
       pbad_c = (BadGuy*) p_c_object;
-      /* Hurt the player if he just touched it: */
 
+     /* Hurt player if he touches a badguy */
       if (!pbad_c->dying && !dying &&
           !safe_timer.started() &&
           pbad_c->mode != HELD)
@@ -744,30 +737,24 @@ Player::collision(void* p_c_object, int c_object)
               pbad_c->mode = HELD;
               pbad_c->base.y-=8;
             }
+          else if (pbad_c->mode == FLAT)
+            {
+              // Don't get hurt if we're kicking a flat badguy!
+            }
           else if (pbad_c->mode == KICK)
             {
-              if (base.y < pbad_c->base.y - 16)
+              /* Hurt if you get hit by kicked laptop: */
+              if (!invincible_timer.started())
                 {
-                  /* Step on (stop being kicked) */
-
-                  pbad_c->mode = FLAT;
-                  play_sound(sounds[SND_STOMP], SOUND_CENTER_SPEAKER);
+                  kill(SHRINK);
                 }
               else
                 {
-                  /* Hurt if you get hit by kicked laptop: */
-                  if (!invincible_timer.started())
-                    {
-                      kill(SHRINK);
-                    }
-                  else
-                    {
-                      pbad_c->dying = DYING_FALLING;
-                      play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
-                      World::current()->add_score(pbad_c->base.x - scroll_x,
-                                                  pbad_c->base.y,
-                                                  25 * player_status.score_multiplier);
-                    }
+                   pbad_c->dying = DYING_FALLING;
+                   play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
+                   World::current()->add_score(pbad_c->base.x - scroll_x,
+                                               pbad_c->base.y,
+                                               25 * player_status.score_multiplier);
                 }
             }
           else
@@ -822,9 +809,6 @@ Player::kill(int mode)
 void
 Player::is_dying()
 {
-  /* He died :^( */
-
-  --player_status.lives;
   remove_powerups();
   dying = DYING_NOT;
 }