Disabled bomb spraying particles all over the screen
[supertux.git] / src / object / invisible_block.cpp
index 19922bd..96be2e6 100644 (file)
@@ -33,7 +33,6 @@ InvisibleBlock::InvisibleBlock(const Vector& pos)
 {
   bbox.set_pos(pos);
   sound_manager->preload("sounds/brick.wav");
-  sound_manager->preload("sounds/brick.wav");
 }
 
 void
@@ -43,24 +42,31 @@ InvisibleBlock::draw(DrawingContext& context)
     sprite->draw(context, get_pos(), LAYER_OBJECTS);
 }
 
-HitResponse
-InvisibleBlock::collision(GameObject& other, const CollisionHit& hit)
+bool
+InvisibleBlock::collides(GameObject& other, const CollisionHit& )
 {
-  if (visible) return Block::collision(other, hit);
+  if(visible)
+    return true;
 
   // if we're not visible, only register a collision if this will make us visible
   Player* player = dynamic_cast<Player*> (&other);
   if ((player) 
           && (player->get_movement().y <= 0)
           && (player->get_bbox().get_top() > get_bbox().get_bottom() - 7.0)) {
-    return Block::collision(other, hit);
+    return true;
   }
 
-  return PASSTHROUGH;
+  return false;
+}
+
+HitResponse
+InvisibleBlock::collision(GameObject& other, const CollisionHit& hit)
+{
+  return Block::collision(other, hit);
 }
 
 void
-InvisibleBlock::hit(Player& )
+InvisibleBlock::hit(Player& player)
 {
   sound_manager->play("sounds/brick.wav");
 
@@ -68,7 +74,7 @@ InvisibleBlock::hit(Player& )
     return;
 
   sprite->set_action("empty");
-  start_bounce();
+  start_bounce(&player);
   set_group(COLGROUP_STATIC);
   visible = true;
 }