fade out console
[supertux.git] / src / object / player.hpp
index 8803372..eb5ab8a 100644 (file)
@@ -32,6 +32,8 @@
 #include "scripting/player.hpp"
 #include "player_status.hpp"
 #include "display_effect.hpp"
+#include "script_interface.hpp"
+#include "console.hpp"
 
 class BadGuy;
 class Portable;
@@ -77,7 +79,7 @@ extern TuxBodyParts* big_tux;
 extern TuxBodyParts* fire_tux;
 extern TuxBodyParts* ice_tux;
 
-class Player : public MovingObject, public Scripting::Player
+class Player : public MovingObject, public Scripting::Player, public ScriptInterface
 {
 public:
   enum HurtMode { KILL, SHRINK };
@@ -92,8 +94,8 @@ private:
   bool dying;
   bool backflipping;
   int  backflip_direction;
+  
 public:
-
   Direction dir;
   Direction old_dir;
 
@@ -104,7 +106,7 @@ public:
   bool jumping;
   bool can_jump;
   bool butt_jump;
-  
+
   Timer invincible_timer;
   Timer skidding_timer;
   Timer safe_timer;
@@ -120,6 +122,9 @@ public:
   Player(PlayerStatus* player_status);
   virtual ~Player();
 
+  virtual void expose(HSQUIRRELVM vm, int table_idx);
+  virtual void unexpose(HSQUIRRELVM vm, int table_idx);
+
   void set_controller(Controller* controller);  
 
   virtual void update(float elapsed_time);
@@ -148,6 +153,11 @@ public:
   // set kick animation
   void kick();
 
+  /**
+   * Adds velocity to the player (be carefull when using this)
+   */
+  void add_velocity(const Vector& velocity);
+
   void bounce(BadGuy& badguy);
 
   bool is_dead() const
@@ -156,10 +166,11 @@ public:
 
   void set_visible(bool visible);
   bool get_visible();
-  
+
+  bool on_ground();
+
 private:
   void handle_input();
-  bool on_ground();
   bool deactivated;
   
   void init();
@@ -173,6 +184,8 @@ private:
 
   bool visible;
 
+  float adjust_height;
+
   Portable* grabbed_object;
 
   Sprite* smalltux_gameover;