- beginnings of a wingling
[supertux.git] / src / player.h
index 7e39b4a..6852ebc 100644 (file)
@@ -112,17 +112,22 @@ class Player : public MovingObject, public Drawable
 public:
   enum HurtMode { KILL, SHRINK };
   enum Power { NONE_POWER, FIRE_POWER, ICE_POWER };
+  enum FallMode { ON_GROUND, JUMPING, TRAMPOLINE_JUMP, FALLING };
 
   player_input_type  input;
   int got_power;
   int size;
   bool duck;
   bool holding_something;
+  bool dead;
   DyingType dying;
 
   Direction dir;
   Direction old_dir;
 
+  float last_ground_y;
+  FallMode fall_mode;
+
   bool jumping;
   bool can_jump;
   bool butt_jump;
@@ -136,6 +141,7 @@ public:
   Timer frame_timer;
   Timer kick_timer;
   Timer shooting_timer;   // used to show the arm when Tux is shooting
+  Timer dying_timer;
   Physic physic;
 
 public:
@@ -148,21 +154,21 @@ public:
   void grabdistros();
 
   virtual void action(float elapsed_time);
-  virtual void draw(ViewPort& viewport, int layer);
+  virtual void draw(Camera& viewport, int layer);
   virtual void collision(const MovingObject& other_object,
       int collision_type);
-  virtual std::string type() const
-  { return "Player"; }
 
   void collision(void* p_c_object, int c_object);
   void kill(HurtMode mode);
-  void is_dying();
-  bool is_dead();
   void player_remove_powerups();
-  void check_bounds(ViewPort& viewport, bool back_scrolling, bool hor_autoscroll);
+  void check_bounds(Camera& viewport, bool back_scrolling, bool hor_autoscroll);
   bool on_ground();
   bool under_solid();
+  bool tiles_on_air(int tiles);
   void grow();
+  void move(const Vector& vector);
+  bool is_dead() const
+  { return dead; }
   
 private:
   void init();