center camera on tux feet, so we get no jumps when tux ducks
[supertux.git] / src / object / weak_block.hpp
index 0ff0b91..01e2464 100644 (file)
 #include "physic.hpp"
 #include "timer.hpp"
 
-/** 
+/**
  * A block that can be destroyed by Bullet hits
  */
-class WeakBlock : public MovingSprite
+class WeakBlock : public MovingSprite, public UsesPhysic
 {
 public:
   WeakBlock(const lisp::Lisp& lisp);
@@ -37,6 +37,17 @@ public:
   HitResponse collision(GameObject& other, const CollisionHit& hit);
   void update(float elapsed_time);
 
+protected:
+  /**
+   * called by self when hit by a bullet
+   */
+  void startBurning();
+
+  /**
+   * pass hit to nearby WeakBlock objects
+   */
+  void spreadHit();
+
 private:
   enum State {
     STATE_NORMAL, /**< default state */
@@ -44,9 +55,6 @@ private:
     STATE_DISINTEGRATING /**< crumbling to dust, no longer solid */
   };
   State state;
-
-  Physic physic;
 };
 
 #endif
-