Explosions destroy bricks
authorLMH <lmh.0013@gmail.com>
Tue, 28 Jan 2014 19:23:46 +0000 (09:23 -1000)
committerLMH <lmh.0013@gmail.com>
Tue, 28 Jan 2014 19:23:46 +0000 (09:23 -1000)
src/object/brick.cpp

index f37c609..8b85905 100644 (file)
@@ -18,8 +18,9 @@
 
 #include "audio/sound_manager.hpp"
 #include "badguy/badguy.hpp"
-#include "object/flower.hpp"
 #include "object/bouncy_coin.hpp"
+#include "object/explosion.hpp"
+#include "object/flower.hpp"
 #include "object/player.hpp"
 #include "object/portable.hpp"
 #include "sprite/sprite_manager.hpp"
@@ -70,6 +71,10 @@ Brick::collision(GameObject& other, const CollisionHit& hit){
       try_break(player);
     }
   }
+  Explosion* explosion = dynamic_cast<Explosion*> (&other);
+  if(explosion && explosion->hurts()) {
+    try_break(player);
+  }
   return Block::collision(other, hit);
 }