projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tux grows faster, stops growing when hit
[supertux.git]
/
src
/
object
/
weak_block.hpp
diff --git
a/src/object/weak_block.hpp
b/src/object/weak_block.hpp
index
2a08179
..
01e2464
100644
(file)
--- 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 <matze@braunis.de>
//
// SuperTux - Weak Block
// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
@@
-26,18
+26,28
@@
#include "physic.hpp"
#include "timer.hpp"
#include "physic.hpp"
#include "timer.hpp"
-/**
+/**
* A block that can be destroyed by Bullet hits
*/
* 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);
{
public:
WeakBlock(const lisp::Lisp& lisp);
- virtual WeakBlock* clone() const { return new WeakBlock(*this); }
HitResponse collision(GameObject& other, const CollisionHit& hit);
void update(float elapsed_time);
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 */
private:
enum State {
STATE_NORMAL, /**< default state */
@@
-45,9
+55,6
@@
private:
STATE_DISINTEGRATING /**< crumbling to dust, no longer solid */
};
State state;
STATE_DISINTEGRATING /**< crumbling to dust, no longer solid */
};
State state;
-
- Physic physic;
};
#endif
};
#endif
-