Removed trailing whitespace from all *.?pp files
[supertux.git] / src / object / player.hpp
index b593455..3dda1fd 100644 (file)
@@ -40,12 +40,13 @@ static const float TUX_INVINCIBLE_TIME = 14.0f;
 static const float TUX_INVINCIBLE_TIME_WARNING = 2.0f;
 static const float GROWING_TIME = 0.35f;
 static const int GROWING_FRAMES = 7;
+static const float TUX_BACKFLIP_TIME = 2.1f; // minimum air time that backflip results in a loss of control
 
 class Camera;
 class PlayerStatus;
 
-class Player : public MovingObject, 
-               public scripting::Player, 
+class Player : public MovingObject,
+               public scripting::Player,
                public ScriptInterface
 {
 public:
@@ -62,6 +63,15 @@ public:
   virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
 
   void set_controller(Controller* controller);
+  /*
+   * Level solved. Don't kill Tux any more.
+   */
+  void set_winning();
+  bool is_winning()
+  {
+    return winning;
+  }
+
   Controller* get_controller()
   {
     return controller;
@@ -159,7 +169,7 @@ public:
    * Adds velocity to the player until given end speed is reached
    */
   void add_velocity(const Vector& velocity, const Vector& end_speed);
-  
+
   /**
    * Returns the current velocity of the player
    */
@@ -212,7 +222,7 @@ public:
    * Orders the current GameSession to start a sequence
    */
   void trigger_sequence(std::string sequence_name);
-  
+
   /**
    * Requests that the player start climbing the given Climbable
    */
@@ -238,6 +248,7 @@ private:
   void activate();
   void deactivate();
   void walk(float speed);
+  void set_dir(bool right);
 
   void do_jump_apex();
   void early_jump_apex();
@@ -251,13 +262,14 @@ private:
   bool deactivated;
 
   Controller* controller;
-  std::auto_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
+  std::unique_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
   PlayerStatus* player_status;
   bool duck;
   bool dead;
 
 private:
   bool dying;
+  bool winning;
   bool backflipping;
   int  backflip_direction;
   Direction peekingX;