projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed jump behaviour: Tux will now jump even if the button was pressed (up to)...
[supertux.git]
/
src
/
object
/
weak_block.hpp
diff --git
a/src/object/weak_block.hpp
b/src/object/weak_block.hpp
index
41a83ae
..
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>
@@
-21,24
+21,32
@@
#ifndef __WEAK_BLOCK_H__
#define __WEAK_BLOCK_H__
#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 "lisp/lisp.hpp"
#include "physic.hpp"
#include "timer.hpp"
-#include "sprite/sprite.hpp"
-/**
+/**
* A block that can be destroyed by Bullet hits
*/
* A block that can be destroyed by Bullet hits
*/
-class WeakBlock : public Moving
Object
+class WeakBlock : public Moving
Sprite, public UsesPhysic
{
public:
WeakBlock(const lisp::Lisp& lisp);
{
public:
WeakBlock(const lisp::Lisp& lisp);
- ~WeakBlock();
HitResponse collision(GameObject& other, const CollisionHit& hit);
void update(float elapsed_time);
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 {
private:
enum State {
@@
-47,10
+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;
- Sprite* sprite;
};
#endif
};
#endif
-