canvi de pc before boromir
This commit is contained in:
@@ -372,25 +372,25 @@ void Player::setAnimation()
|
||||
if (firing_state_ == PlayerState::FIRING_NONE)
|
||||
{
|
||||
// No esta disparando
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION);
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION, false);
|
||||
player_sprite_->setFlip(FLIP_WALK);
|
||||
}
|
||||
else if (isRecoiling())
|
||||
{
|
||||
// Retroceso
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION + RECOIL_ANIMATION);
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION + RECOIL_ANIMATION, false);
|
||||
player_sprite_->setFlip(FLIP_RECOIL);
|
||||
}
|
||||
else if (isCooling())
|
||||
{
|
||||
// Acaba de disparar
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION + COOL_ANIMATION);
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION + COOL_ANIMATION, false);
|
||||
player_sprite_->setFlip(FLIP_COOL);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Está disparando
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION + FIRE_ANIMATION);
|
||||
player_sprite_->setCurrentAnimation(WALK_ANIMATION + FIRE_ANIMATION, false);
|
||||
// Si dispara de lado, invierte el sprite segun hacia donde dispara
|
||||
// Si dispara recto, invierte el sprite segun hacia donde camina
|
||||
player_sprite_->setFlip(FIRE_ANIMATION == "-fire-center" ? FLIP_WALK : FLIP_FIRE);
|
||||
@@ -454,6 +454,16 @@ void Player::updateCooldown()
|
||||
}
|
||||
|
||||
--cant_fire_counter_;
|
||||
if (cant_fire_counter_ == 0)
|
||||
{
|
||||
recoiling_state_counter_ = recoiling_state_duration_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (recoiling_state_counter_ > 0)
|
||||
{
|
||||
--recoiling_state_counter_;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -488,6 +498,7 @@ void Player::updateCooldown()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actualiza al jugador a su posicion, animación y controla los contadores
|
||||
void Player::update()
|
||||
|
||||
@@ -162,7 +162,7 @@ private:
|
||||
static constexpr int WIDTH_ = 30; // Anchura
|
||||
static constexpr int HEIGHT_ = 30; // Altura
|
||||
static constexpr float BASE_SPEED_ = 1.5f; // Velocidad base del jugador
|
||||
static constexpr int COOLING_DURATION_ = 30;
|
||||
static constexpr int COOLING_DURATION_ = 50;
|
||||
static constexpr int COOLING_COMPLETE_ = 0;
|
||||
|
||||
// --- Objetos y punteros ---
|
||||
|
||||
Reference in New Issue
Block a user