Afegides veus al jugador
Afegit efectes de so al rebotar el jugador quan mor
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include "param.h" // Para Param, ParamGame, param
|
||||
#include "scoreboard.h" // Para Scoreboard, ScoreboardMode
|
||||
#include "texture.h" // Para Texture
|
||||
#include "resource.h"
|
||||
#include "jail_audio.h"
|
||||
|
||||
// Constructor
|
||||
Player::Player(int id, float x, int y, bool demo, SDL_Rect &play_area, std::vector<std::shared_ptr<Texture>> texture, const std::vector<std::vector<std::string>> &animations)
|
||||
@@ -175,6 +177,7 @@ void Player::move()
|
||||
if ((player_sprite_->getPosX() < play_area_.x) || (player_sprite_->getPosX() + WIDTH_ > play_area_.w))
|
||||
{
|
||||
player_sprite_->setVelX(-player_sprite_->getVelX());
|
||||
JA_PlaySound(Resource::get()->getSound("bubble4.wav"));
|
||||
}
|
||||
|
||||
// Si el cadaver toca el suelo cambia el estado
|
||||
@@ -188,6 +191,7 @@ void Player::move()
|
||||
pos_y_ = default_pos_y_;
|
||||
player_sprite_->clear();
|
||||
shiftSprite();
|
||||
JA_PlaySound(Resource::get()->getSound("bubble4.wav"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -195,6 +199,7 @@ void Player::move()
|
||||
player_sprite_->setPosY(play_area_.h - HEIGHT_);
|
||||
player_sprite_->setVelY(player_sprite_->getVelY() * -0.5f);
|
||||
player_sprite_->setVelX(player_sprite_->getVelX() * 0.75f);
|
||||
JA_PlaySound(Resource::get()->getSound("bubble4.wav"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user