Moved Block code to block.cpp, was in the wrong file, i.e. bonus_block.cpp
authorIngo Ruhnke <grumbel@gmail.com>
Sun, 17 Aug 2014 01:46:23 +0000 (03:46 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Sun, 17 Aug 2014 01:46:23 +0000 (03:46 +0200)
src/object/block.cpp
src/object/bonus_block.cpp

index 1f05d79..dd1272f 100644 (file)
 
 #include "audio/sound_manager.hpp"
 #include "badguy/badguy.hpp"
+#include "object/broken_brick.hpp"
 #include "object/coin.hpp"
 #include "object/flower.hpp"
 #include "object/growup.hpp"
 #include "object/player.hpp"
 #include "object/portable.hpp"
 #include "supertux/constants.hpp"
+#include "supertux/sector.hpp"
 
 static const float BOUNCY_BRICK_MAX_OFFSET = 8;
 static const float BOUNCY_BRICK_SPEED = 90;
@@ -145,4 +147,22 @@ Block::start_break(GameObject* hitter)
   breaking = true;
 }
 
+void
+Block::break_me()
+{
+  Sector* sector = Sector::current();
+  sector->add_object(
+    new BrokenBrick(sprite->clone(), get_pos(), Vector(-100, -400)));
+  sector->add_object(
+    new BrokenBrick(sprite->clone(), get_pos() + Vector(0, 16),
+                    Vector(-150, -300)));
+  sector->add_object(
+    new BrokenBrick(sprite->clone(), get_pos() + Vector(16, 0),
+                    Vector(100, -400)));
+  sector->add_object(
+    new BrokenBrick(sprite->clone(), get_pos() + Vector(16, 16),
+                    Vector(150, -300)));
+  remove_me();
+}
+
 /* EOF */
index c2d04c6..044f470 100644 (file)
@@ -19,7 +19,6 @@
 #include "audio/sound_manager.hpp"
 #include "badguy/badguy.hpp"
 #include "lisp/list_iterator.hpp"
-#include "object/broken_brick.hpp"
 #include "object/flower.hpp"
 #include "object/bouncy_coin.hpp"
 #include "object/coin_explode.hpp"
@@ -451,24 +450,6 @@ BonusBlock::try_drop(Player *player)
 }
 
 void
-Block::break_me()
-{
-  Sector* sector = Sector::current();
-  sector->add_object(
-    new BrokenBrick(sprite->clone(), get_pos(), Vector(-100, -400)));
-  sector->add_object(
-    new BrokenBrick(sprite->clone(), get_pos() + Vector(0, 16),
-                    Vector(-150, -300)));
-  sector->add_object(
-    new BrokenBrick(sprite->clone(), get_pos() + Vector(16, 0),
-                    Vector(100, -400)));
-  sector->add_object(
-    new BrokenBrick(sprite->clone(), get_pos() + Vector(16, 16),
-                    Vector(150, -300)));
-  remove_me();
-}
-
-void
 BonusBlock::draw(DrawingContext& context){
   // do the regular drawing first
   Block::draw(context);