hopefully fixed the crash on exit, keep sectors script bundled in the sector and...
[supertux.git] / src / object / player.cpp
index 97a93d3..1769811 100644 (file)
@@ -41,6 +41,7 @@
 #include "object/bullet.hpp"
 #include "trigger/trigger_base.hpp"
 #include "control/joystickkeyboardcontroller.hpp"
+#include "scripting/wrapper_util.hpp"
 #include "main.hpp"
 #include "platform.hpp"
 #include "badguy/badguy.hpp"
@@ -106,6 +107,7 @@ Player::Player(PlayerStatus* _player_status)
   smalltux_gameover = sprite_manager->create("images/creatures/tux_small/smalltux-gameover.sprite");
   smalltux_star = sprite_manager->create("images/creatures/tux_small/smalltux-star.sprite");
   bigtux_star = sprite_manager->create("images/creatures/tux_big/bigtux-star.sprite");
+
   init();
 }
 
@@ -120,9 +122,9 @@ void
 Player::init()
 {
   if(is_big())
-    bbox.set_size(31.8, 63.8);
+    bbox.set_size(31.8, 62.8);
   else
-    bbox.set_size(31.8, 31.8);
+    bbox.set_size(31.8, 30.8);
   adjust_height = 0;
 
   dir = RIGHT;
@@ -150,6 +152,19 @@ Player::init()
 }
 
 void
+Player::expose(HSQUIRRELVM vm, int table_idx)
+{
+  Scripting::Player* interface = static_cast<Scripting::Player*> (this);
+  expose_object(vm, table_idx, interface, "Tux", false);
+}
+
+void
+Player::unexpose(HSQUIRRELVM vm, int table_idx)
+{
+  Scripting::unexpose_object(vm, table_idx, "Tux");
+}
+
+void
 Player::set_controller(Controller* controller)
 {
   this->controller = controller;
@@ -525,7 +540,7 @@ Player::set_bonus(BonusType type, bool animate)
     return;
   
   if(player_status->bonus == NO_BONUS) {
-    adjust_height = 63.8;
+    adjust_height = 62.8;
     if(animate)
       growing_timer.start(GROWING_TIME);
   }
@@ -834,7 +849,7 @@ Player::kill(HurtMode mode)
         {
           //growing_timer.start(GROWING_TIME);
           safe_timer.start(TUX_SAFE_TIME /* + GROWING_TIME */);
-          adjust_height = 31.8;
+          adjust_height = 30.8;
           duck = false;
           player_status->bonus = NO_BONUS;
         }
@@ -949,3 +964,4 @@ void Player::walk(float speed)
 {
   physic.set_velocity_x(speed);
 }
+