#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);
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 */
STATE_DISINTEGRATING /**< crumbling to dust, no longer solid */
};
State state;
-
- Physic physic;
};
#endif
-