X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fplayer.cpp;h=92cd5880a46b84193c9c5311469a0fbd5a6db938;hb=e8a1d89d3d0f4824d3d906ca67149afec0a75e4b;hp=e4d8c6efbe22b7650c8d172410b4cebc8d2c412c;hpb=495f8b77cb935fe8eff81bec755efca8e34e8a99;p=supertux.git diff --git a/src/object/player.cpp b/src/object/player.cpp index e4d8c6efb..92cd5880a 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -550,18 +550,17 @@ Player::handle_vertical_input() } } -#if 0 /* In case the player has pressed Down while in a certain range of air, enable butt jump action */ if (input.down && !butt_jump && !duck) - if(tiles_on_air(TILES_FOR_BUTTJUMP) && jumping) + //if(tiles_on_air(TILES_FOR_BUTTJUMP) && jumping) butt_jump = true; -#endif /* When Down is not held anymore, disable butt jump */ if(butt_jump && !input.down) butt_jump = false; +#if 0 // Do butt jump if (butt_jump && on_ground() && is_big()) { @@ -574,7 +573,6 @@ Player::handle_vertical_input() butt_jump = false; -#if 0 // Break bricks beneath Tux if(Sector::current()->trybreakbrick( Vector(base.x + 1, base.y + base.height), false) @@ -584,9 +582,7 @@ Player::handle_vertical_input() physic.set_velocity_y(2); butt_jump = true; } -#endif -#if 0 // Kill nearby badguys std::vector gameobjects = Sector::current()->gameobjects; for (std::vector::iterator i = gameobjects.begin(); @@ -606,8 +602,8 @@ Player::handle_vertical_input() } } } -#endif } +#endif /** jumping is only allowed if we're about to touch ground soon and if the * button has been up in between the last jump @@ -932,6 +928,7 @@ Player::kill(HurtMode mode) physic.set_acceleration(0, 0); physic.set_velocity(0, 700); player_status->lives -= 1; + player_status->bonus = NO_BONUS; dying = true; dying_timer.start(3.0); flags |= FLAG_NO_COLLDET; @@ -948,6 +945,7 @@ Player::move(const Vector& vector) bbox.set_size(31.8, 31.8); on_ground_flag = false; duck = false; + last_ground_y = vector.y; input.reset(); physic.reset(); @@ -976,10 +974,10 @@ Player::check_bounds(Camera* camera) bbox.set_pos(Vector(camera->get_translation().x, get_pos().y)); adjust = true; } - if(get_pos().x >= camera->get_translation().x + screen->w - bbox.get_width()) + if(get_pos().x >= camera->get_translation().x + SCREEN_WIDTH - bbox.get_width()) { bbox.set_pos(Vector( - camera->get_translation().x + screen->w - bbox.get_width(), + camera->get_translation().x + SCREEN_WIDTH - bbox.get_width(), get_pos().y)); adjust = true; }