X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Fplayer.cpp;h=93c10942c364458c0757927adee26271a872d294;hb=8e52a5b000d732e96b1cc461163c4778b434dc27;hp=a891b80f7e117f82ae755f9be47c83540141f2ac;hpb=3cb2b7789c9f8de862cff6b1989be84a9fe8ed16;p=supertux.git diff --git a/src/object/player.cpp b/src/object/player.cpp index a891b80f7..93c10942c 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -185,7 +185,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) : SoundManager::current()->preload("sounds/skid.wav"); SoundManager::current()->preload("sounds/flip.wav"); SoundManager::current()->preload("sounds/invincible_start.ogg"); - SoundManager::current()->preload("sounds/splash.ogg"); + SoundManager::current()->preload("sounds/splash.wav"); init(); } @@ -416,6 +416,7 @@ Player::update(float elapsed_time) if (backflipping && (backflip_timer.get_timegone() > 0.15f)) { backflipping = false; backflip_direction = 0; + physic.set_velocity_x(0); if (!stone) { sprite->set_angle(0.0f); powersprite->set_angle(0.0f); @@ -981,8 +982,6 @@ Player::try_grab() // make sure the Portable is a MovingObject MovingObject* moving_object = dynamic_cast (portable); assert(moving_object); - if(moving_object == NULL) - continue; // make sure the Portable isn't currently non-solid if(moving_object->get_group() == COLGROUP_DISABLED) continue; @@ -1314,7 +1313,11 @@ Player::draw(DrawingContext& context) } } else { - sprite->draw(context, get_pos(), LAYER_OBJECTS + 1); + if(dying) + sprite->draw(context, get_pos(), Sector::current()->get_foremost_layer() + 1); + else + sprite->draw(context, get_pos(), LAYER_OBJECTS + 1); + if (player_status->bonus == AIR_BONUS) powersprite->draw(context, get_pos(), LAYER_OBJECTS + 1); } @@ -1338,7 +1341,7 @@ Player::collision_tile(uint32_t tile_attributes) if( tile_attributes & Tile::WATER ){ swimming = true; no_water = false; - SoundManager::current()->play( "sounds/splash.ogg" ); + SoundManager::current()->play( "sounds/splash.wav" ); } } #endif @@ -1523,7 +1526,7 @@ Player::kill(bool completely) // TODO: need nice way to handle players dying in co-op mode Sector::current()->effect->fade_out(3.0); - SoundManager::current()->stop_music(3.0); + SoundManager::current()->pause_music(3.0); } }