X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fweak_block.hpp;h=01e2464be66496068588c11253641cbeff826fe1;hb=20f50f690c18aefbedeeb43eda094c8cb70351a9;hp=41a83ae01544df4d05ef0ee1021c8207737dacc6;hpb=716d5248e22793b65a57fdd476fe43f0f0646beb;p=supertux.git diff --git a/src/object/weak_block.hpp b/src/object/weak_block.hpp index 41a83ae01..01e2464be 100644 --- a/src/object/weak_block.hpp +++ b/src/object/weak_block.hpp @@ -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 @@ -21,24 +21,32 @@ #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 -