added unstable_tile object
[supertux.git] / src / object / unstable_tile.h
1 #ifndef __UNSTABLE_TILE_H__
2 #define __UNSTABLE_TILE_H__
3
4 #include "special/moving_object.h"
5 #include "lisp/lisp.h"
6 #include "math/physic.h"
7 #include "timer.h"
8
9 namespace SuperTux {
10   class Sprite;
11 }
12 class Player;
13
14 using namespace SuperTux;
15
16 /** A tile that starts falling down if tux stands to long on it */
17 class UnstableTile : public MovingObject
18 {
19 public:
20   UnstableTile(const lisp::Lisp& lisp);
21   ~UnstableTile();
22
23   HitResponse collision(GameObject& other, const CollisionHit& hit);
24   void action(float elapsed_time);
25   void draw(DrawingContext& context);
26
27 private:
28   Physic physic;
29   Sprite* sprite;
30   Timer2 timer;
31   bool hit;
32   bool falling;
33 };
34
35 #endif
36