eliminats metodes frame-based obsolets

This commit is contained in:
2025-09-19 09:56:25 +02:00
parent 49a3989ecf
commit 568b941990
26 changed files with 90 additions and 608 deletions

View File

@@ -149,41 +149,6 @@ void Player::setInputEnteringName(Input::Action action) {
name_entry_idle_time_accumulator_ = 0.0f;
}
// Mueve el jugador a la posición y animación que le corresponde
void Player::move() {
switch (playing_state_) {
case State::PLAYING:
handlePlayingMovement();
break;
case State::ROLLING:
handleRollingMovement();
break;
case State::TITLE_ANIMATION:
handleTitleAnimation();
break;
case State::CONTINUE_TIME_OUT:
handleContinueTimeOut();
break;
case State::LEAVING_SCREEN:
handleLeavingScreen();
break;
case State::ENTERING_SCREEN:
handleEnteringScreen();
break;
case State::CREDITS:
handleCreditsMovement();
break;
case State::WAITING:
handleWaitingMovement();
break;
case State::RECOVER:
handleRecoverMovement();
break;
default:
break;
}
}
// Fase 1: Sistema de movimiento time-based
void Player::move(float deltaTime) {
switch (playing_state_) {
@@ -191,28 +156,28 @@ void Player::move(float deltaTime) {
handlePlayingMovement(deltaTime);
break;
case State::ROLLING:
handleRollingMovement(); // Usa MovingSprite que ya soporta deltaTime
handleRollingMovement();
break;
case State::TITLE_ANIMATION:
handleTitleAnimation(); // Sin cambios - usa solo animaciones
handleTitleAnimation();
break;
case State::CONTINUE_TIME_OUT:
handleContinueTimeOut(); // Sin cambios - usa MovingSprite que ya soporta deltaTime
handleContinueTimeOut();
break;
case State::LEAVING_SCREEN:
handleLeavingScreen(); // Sin cambios - usa MovingSprite que ya soporta deltaTime
handleLeavingScreen();
break;
case State::ENTERING_SCREEN:
handleEnteringScreen(); // Sin cambios - usa MovingSprite que ya soporta deltaTime
handleEnteringScreen();
break;
case State::CREDITS:
handleCreditsMovement(deltaTime); // Fase 4: Sistema de créditos time-based
handleCreditsMovement(deltaTime);
break;
case State::WAITING:
handleWaitingMovement(deltaTime); // Fase 4: Sistema de waiting time-based
handleWaitingMovement(deltaTime);
break;
case State::RECOVER:
handleRecoverMovement(); // Sin cambios - usa AnimatedSprite que ya soporta deltaTime
handleRecoverMovement();
break;
default:
break;
@@ -548,47 +513,6 @@ auto Player::computeAnimation() const -> std::pair<std::string, SDL_FlipMode> {
return {anim_name, flip_mode};
}
// Establece la animación correspondiente al estado (frame-based)
void Player::setAnimation() {
switch (playing_state_) {
case State::PLAYING:
case State::ENTERING_NAME_GAME_COMPLETED:
case State::ENTERING_SCREEN:
case State::LEAVING_SCREEN:
case State::TITLE_ANIMATION:
case State::CREDITS: {
auto [animName, flipMode] = computeAnimation();
player_sprite_->setCurrentAnimation(animName, false);
player_sprite_->setFlip(flipMode);
break;
}
case State::RECOVER:
player_sprite_->setCurrentAnimation("recover");
break;
case State::WAITING:
case State::GAME_OVER:
player_sprite_->setCurrentAnimation("hello");
break;
case State::ROLLING:
case State::CONTINUE_TIME_OUT:
player_sprite_->setCurrentAnimation("rolling");
break;
case State::LYING_ON_THE_FLOOR_FOREVER:
case State::ENTERING_NAME:
case State::CONTINUE:
player_sprite_->setCurrentAnimation("dizzy");
break;
case State::CELEBRATING:
player_sprite_->setCurrentAnimation("celebration");
break;
default:
break;
}
player_sprite_->update();
power_sprite_->update();
}
// Fase 1: Establece la animación correspondiente al estado (time-based)
void Player::setAnimation(float deltaTime) {
switch (playing_state_) {