d8be47df1bf8a2157f6f545028f764a20be6d3b2
[supertux.git] / src / moving_object.h
1 #ifndef __MOVING_OBJECT_H__
2 #define __MOVING_OBJECT_H__
3
4 #include "type.h"
5 #include "game_object.h"
6 #include "vector.h"
7 //#include "rectangle.h"
8
9 /**
10  * Base class for all dynamic/moving game objects. This class contains things
11  * for handling the bounding boxes and collision feedback.
12  */
13 class MovingObject : public _GameObject
14 {
15 public:
16   MovingObject();
17   virtual ~MovingObject();
18
19   /** this function is called when the object collided with any other object
20    */
21   virtual void collision(const MovingObject& other_object, 
22           int collision_type) = 0;
23
24   base_type base;
25   base_type old_base;
26
27 protected:
28 #if 0 // this will be used in my collision detection rewrite later
29   /// the current position of the object
30   Vector pos;
31   /// the position we want to move until next frame
32   Vector new_pos;
33   /// the bounding box relative to the current position
34   Rectangle bounding_box;
35 #endif
36 };
37
38 #endif
39