added jam build system, please try it out - the advantage would be that it already...
[supertux.git] / src / badguy / badguy.cpp
index 3754414..cfa3af2 100644 (file)
@@ -24,8 +24,11 @@ BadGuy::draw(DrawingContext& context)
     return;
   if(state == STATE_INIT || state == STATE_INACTIVE)
     return;
-    
-  sprite->draw(context, get_pos(), LAYER_OBJECTS);
+  if(state == STATE_FALLING) {
+      sprite->draw(context, get_pos(), LAYER_OBJECTS, VERTICAL_FLIP);
+  } else {
+      sprite->draw(context, get_pos(), LAYER_OBJECTS);
+  }
 }
 
 void
@@ -78,7 +81,7 @@ BadGuy::active_action(float elapsed_time)
 }
 
 void
-BadGuy::inactive_action(float elapsed_time)
+BadGuy::inactive_action(float )
 {
 }
 
@@ -115,7 +118,7 @@ BadGuy::collision(GameObject& other, const CollisionHit& hit)
 }
 
 HitResponse
-BadGuy::collision_solid(GameObject& other, const CollisionHit& hit)
+BadGuy::collision_solid(GameObject& , const CollisionHit& )
 {
   return FORCE_MOVE;
 }
@@ -136,13 +139,13 @@ BadGuy::collision_player(Player& player, const CollisionHit& hit)
 }
 
 HitResponse
-BadGuy::collision_badguy(BadGuy& other, const CollisionHit& hit)
+BadGuy::collision_badguy(BadGuy& , const CollisionHit& )
 {
   return FORCE_MOVE;
 }
 
 bool
-BadGuy::collision_squished(Player& player)
+BadGuy::collision_squished(Player& )
 {
   return false;
 }
@@ -161,10 +164,11 @@ BadGuy::kill_squished(Player& player)
 void
 BadGuy::kill_fall()
 {
+  SoundManager::get()->play_sound(IDToSound(SND_FALL), this,
+      Sector::current()->player->get_pos());
   physic.set_velocity_y(0);
   physic.enable_gravity(true);
   set_state(STATE_FALLING);
-  remove_me();
 }
 
 void