added a powerup object that can be placed in levels and represent various powerups...
[supertux.git] / src / object / gameobjs.h
index 3d928be..886c524 100644 (file)
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //  02111-1307, USA.
-
 #ifndef SUPERTUX_GAMEOBJS_H
 #define SUPERTUX_GAMEOBJS_H
 
 #include "video/surface.h"
 #include "timer.h"
-#include "scene.h"
-#include "math/physic.h"
-#include "special/game_object.h"
-#include "special/moving_object.h"
+#include "physic.h"
+#include "game_object.h"
+#include "moving_object.h"
 #include "serializable.h"
-#include "utils/lispwriter.h"
 
 /* Bounciness of distros: */
 #define NO_BOUNCE 0
 #define BOUNCE 1
 
-namespace SuperTux {
 class Sprite;
-}
 
 class BouncyCoin : public GameObject
 {
 public:
   BouncyCoin(const Vector& pos);
   ~BouncyCoin();
-  virtual void action(float elapsed_time);
+  virtual void update(float elapsed_time);
   virtual void draw(DrawingContext& context);
 
 private:
   Sprite* sprite;
   Vector position;
-  Timer2 timer;
+  Timer timer;
 };
 
 class BrokenBrick : public GameObject
@@ -59,11 +54,11 @@ public:
   BrokenBrick(Sprite* sprite, const Vector& pos, const Vector& movement);
   ~BrokenBrick();
 
-  virtual void action(float elapsed_time);
+  virtual void update(float elapsed_time);
   virtual void draw(DrawingContext& context);
 
 private:
-  Timer2 timer;
+  Timer timer;
   Sprite* sprite;
   Vector position;
   Vector movement;
@@ -75,39 +70,14 @@ public:
   FloatingText(const Vector& pos, const std::string& text_);
   FloatingText(const Vector& pos, int s);  // use this for score, for instance
   
-  virtual void action(float elapsed_time);
+  virtual void update(float elapsed_time);
   virtual void draw(DrawingContext& context);
 
 private:
   Vector position;
   std::string text;
-  Timer2 timer;  
-};
-
-#if 0
-extern Sprite *img_trampoline;
-
-class Trampoline : public MovingObject, public Serializable
-{
-public:
-  Trampoline(LispReader& reader);
-  Trampoline(float x, float y);
-  virtual void write(LispWriter& writer);
-  virtual void action(float frame_ratio);
-  virtual void draw(DrawingContext& context);
-
-  virtual void collision(const MovingObject& other, int);
-  void collision(void *p_c_object, int c_object, CollisionType type);
-
-  Physic physic;
-  enum { M_NORMAL, M_HELD } mode;
-
- private:
-  float power;
-  unsigned int frame;
+  Timer timer;  
 };
-#endif
 
 extern Sprite *img_smoke_cloud;
 
@@ -116,11 +86,11 @@ class SmokeCloud : public GameObject
 public:
   SmokeCloud(const Vector& pos);
   
-  virtual void action(float elapsed_time);
+  virtual void update(float elapsed_time);
   virtual void draw(DrawingContext& context);
 
 private:
-  Timer2 timer;
+  Timer timer;
   Vector position;
 };
 
@@ -132,12 +102,12 @@ public:
             int number, Color color, int size, float life_time, int drawing_layer);
   ~Particles();
   
-  virtual void action(float elapsed_time);
+  virtual void update(float elapsed_time);
   virtual void draw(DrawingContext& context);
 
 private:
   Vector accel;
-  Timer2 timer;
+  Timer timer;
   bool live_forever;
 
   Color color;