#include "object/sprite_particle.hpp"
#include "scripting/squirrel_util.hpp"
#include "supertux/game_session.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
#include "supertux/sector.hpp"
#include "supertux/tile.hpp"
#include "trigger/climbable.hpp"
-#include <cmath>
+#include <math.h>
//#define SWIMMING
}
Player::Player(PlayerStatus* _player_status, const std::string& name) :
+ deactivated(),
+ controller(),
scripting_controller(0),
player_status(_player_status),
+ duck(),
+ dead(),
+ dying(),
+ backflipping(),
+ backflip_direction(),
+ peekingX(),
+ peekingY(),
+ swimming(),
+ speedlimit(),
scripting_controller_old(0),
+ jump_early_apex(),
+ on_ice(),
+ ice_this_frame(),
+ dir(),
+ old_dir(),
+ last_ground_y(),
+ fall_mode(),
+ on_ground_flag(),
+ jumping(),
+ can_jump(),
+ jump_button_timer(),
+ wants_buttjump(),
+ does_buttjump(),
+ invincible_timer(),
+ skidding_timer(),
+ safe_timer(),
+ kick_timer(),
+ shooting_timer(),
+ dying_timer(),
+ growing(),
+ backflip_timer(),
+ physic(),
+ visible(),
grabbed_object(NULL),
+ sprite(),
+ airarrow(),
+ floor_normal(),
ghost_mode(false),
edit_mode(false),
+ unduck_hurt_timer(),
+ idle_timer(),
idle_stage(0),
climbing(0)
{
controller = g_main_controller;
scripting_controller.reset(new CodeController());
sprite = sprite_manager->create("images/creatures/tux/tux.sprite");
- airarrow.reset(new Surface("images/engine/hud/airarrow.png"));
+ airarrow = Surface::create("images/engine/hud/airarrow.png");
idle_timer.start(IDLE_TIME[0]/1000.0f);
sound_manager->preload("sounds/bigjump.wav");
if (name.empty())
return;
- Scripting::expose_object(vm, table_idx, dynamic_cast<Scripting::Player *>(this), name, false);
+ scripting::expose_object(vm, table_idx, dynamic_cast<scripting::Player *>(this), name, false);
}
void
if (name.empty())
return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
float
if(hit.left || hit.right) {
try_grab(); //grab objects right now, in update it will be too late
}
-#ifdef DEBUG
assert(dynamic_cast<MovingObject*> (&other) != NULL);
-#endif
MovingObject* moving_object = static_cast<MovingObject*> (&other);
if(moving_object->get_group() == COLGROUP_TOUCHABLE) {
TriggerBase* trigger = dynamic_cast<TriggerBase*> (&other);
physic.set_velocity_y(-300);
}
-//Scripting Functions Below
+//scripting Functions Below
void
Player::deactivate()