Changed jump behaviour: Tux will now jump even if the button was pressed (up to)...
[supertux.git] / src / object / weak_block.hpp
index 41a83ae..01e2464 100644 (file)
@@ -1,4 +1,4 @@
-//  $Id: weak_block.hpp 3327 2006-04-13 15:02:40Z ravu_al_hemio $
+//  $Id$
 //
 //  SuperTux - Weak Block
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 #ifndef __WEAK_BLOCK_H__
 #define __WEAK_BLOCK_H__
 
-#include "moving_object.hpp"
+#include "object/moving_sprite.hpp"
 #include "lisp/lisp.hpp"
 #include "physic.hpp"
 #include "timer.hpp"
-#include "sprite/sprite.hpp"
 
-/** 
+/**
  * A block that can be destroyed by Bullet hits
  */
-class WeakBlock : public MovingObject
+class WeakBlock : public MovingSprite, public UsesPhysic
 {
 public:
   WeakBlock(const lisp::Lisp& lisp);
-  ~WeakBlock();
 
   HitResponse collision(GameObject& other, const CollisionHit& hit);
   void update(float elapsed_time);
-  void draw(DrawingContext& context);
+
+protected:
+  /**
+   * called by self when hit by a bullet
+   */
+  void startBurning();
+
+  /**
+   * pass hit to nearby WeakBlock objects
+   */
+  void spreadHit();
 
 private:
   enum State {
@@ -47,10 +55,6 @@ private:
     STATE_DISINTEGRATING /**< crumbling to dust, no longer solid */
   };
   State state;
-
-  Physic physic;
-  Sprite* sprite;
 };
 
 #endif
-