-// $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:
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 {
State state;
Physic physic;
- Sprite* sprite;
};
#endif
-