dead = false;
dying = false;
+ winning = false;
peekingX = AUTO;
peekingY = AUTO;
last_ground_y = 0;
this->controller = controller;
}
+void
+Player::set_winning()
+{
+ if( ! is_winning() ){
+ winning = true;
+ invincible_timer.start(10000.0f);
+ }
+}
+
void
Player::use_scripting_controller(bool use_or_release)
{
}
}
- // do not run if we're holding something
- if ( false /* grabbed_extra_heavy_object */) {
+ // do not run if we're holding something which slows us down
+ if ( grabbed_object && grabbed_object->is_hampering() ) {
ax = dirsign * WALK_ACCELERATION_X;
// limit speed
if(vx >= MAX_WALK_XM && dirsign > 0) {
void
Player::kill(bool completely)
{
- if(dying || deactivated)
+ if(dying || deactivated || is_winning() )
return;
if(!completely && (safe_timer.started() || invincible_timer.started()))
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;
private:
bool dying;
+ bool winning;
bool backflipping;
int backflip_direction;
Direction peekingX;
end_sequence->start();
sound_manager->play_music("music/leveldone.ogg", false);
- currentsector->player->invincible_timer.start(10000.0f);
+ currentsector->player->set_winning();
// Stop all clocks.
for(std::vector<GameObject*>::iterator i = currentsector->gameobjects.begin();