eliminats metodes frame-based obsolets
This commit is contained in:
@@ -113,13 +113,6 @@ void GameLogo::render() {
|
||||
}
|
||||
}
|
||||
|
||||
// Actualiza la lógica de la clase (frame-based)
|
||||
void GameLogo::update() {
|
||||
updateCoffeeCrisis();
|
||||
updateArcadeEdition();
|
||||
updatePostFinishedCounter();
|
||||
}
|
||||
|
||||
// Actualiza la lógica de la clase (time-based)
|
||||
void GameLogo::update(float deltaTime) {
|
||||
updateCoffeeCrisis(deltaTime);
|
||||
@@ -127,22 +120,6 @@ void GameLogo::update(float deltaTime) {
|
||||
updatePostFinishedCounter(deltaTime);
|
||||
}
|
||||
|
||||
void GameLogo::updateCoffeeCrisis() {
|
||||
switch (coffee_crisis_status_) {
|
||||
case Status::MOVING:
|
||||
handleCoffeeCrisisMoving();
|
||||
break;
|
||||
case Status::SHAKING:
|
||||
handleCoffeeCrisisShaking();
|
||||
break;
|
||||
case Status::FINISHED:
|
||||
handleCoffeeCrisisFinished();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::updateCoffeeCrisis(float deltaTime) {
|
||||
switch (coffee_crisis_status_) {
|
||||
case Status::MOVING:
|
||||
@@ -159,19 +136,6 @@ void GameLogo::updateCoffeeCrisis(float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::updateArcadeEdition() {
|
||||
switch (arcade_edition_status_) {
|
||||
case Status::MOVING:
|
||||
handleArcadeEditionMoving();
|
||||
break;
|
||||
case Status::SHAKING:
|
||||
handleArcadeEditionShaking();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::updateArcadeEdition(float deltaTime) {
|
||||
switch (arcade_edition_status_) {
|
||||
case Status::MOVING:
|
||||
@@ -185,16 +149,6 @@ void GameLogo::updateArcadeEdition(float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::handleCoffeeCrisisMoving() {
|
||||
coffee_sprite_->update();
|
||||
crisis_sprite_->update();
|
||||
|
||||
if (coffee_sprite_->hasFinished() && crisis_sprite_->hasFinished()) {
|
||||
coffee_crisis_status_ = Status::SHAKING;
|
||||
playTitleEffects();
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::handleCoffeeCrisisMoving(float deltaTime) {
|
||||
coffee_sprite_->update(deltaTime);
|
||||
crisis_sprite_->update(deltaTime);
|
||||
@@ -205,16 +159,6 @@ void GameLogo::handleCoffeeCrisisMoving(float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::handleCoffeeCrisisShaking() {
|
||||
if (shake_.remaining > 0) {
|
||||
processShakeEffect(coffee_sprite_.get(), crisis_sprite_.get());
|
||||
} else {
|
||||
finishCoffeeCrisisShaking();
|
||||
}
|
||||
|
||||
updateDustSprites();
|
||||
}
|
||||
|
||||
void GameLogo::handleCoffeeCrisisShaking(float deltaTime) {
|
||||
if (shake_.remaining > 0) {
|
||||
processShakeEffect(coffee_sprite_.get(), crisis_sprite_.get(), deltaTime);
|
||||
@@ -225,23 +169,10 @@ void GameLogo::handleCoffeeCrisisShaking(float deltaTime) {
|
||||
updateDustSprites(deltaTime);
|
||||
}
|
||||
|
||||
void GameLogo::handleCoffeeCrisisFinished() {
|
||||
updateDustSprites();
|
||||
}
|
||||
|
||||
void GameLogo::handleCoffeeCrisisFinished(float deltaTime) {
|
||||
updateDustSprites(deltaTime);
|
||||
}
|
||||
|
||||
void GameLogo::handleArcadeEditionMoving() {
|
||||
zoom_ -= 0.1F * ZOOM_FACTOR;
|
||||
arcade_edition_sprite_->setZoom(zoom_);
|
||||
|
||||
if (zoom_ <= 1.0F) {
|
||||
finishArcadeEditionMoving();
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::handleArcadeEditionMoving(float deltaTime) {
|
||||
// Convertir 0.1F * ZOOM_FACTOR por frame a por milisegundo (asumiendo 60fps)
|
||||
zoom_ -= (0.1F * ZOOM_FACTOR) * deltaTime / (1000.0F / 60.0F);
|
||||
@@ -252,15 +183,6 @@ void GameLogo::handleArcadeEditionMoving(float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::handleArcadeEditionShaking() {
|
||||
if (shake_.remaining > 0) {
|
||||
processArcadeEditionShake();
|
||||
} else {
|
||||
arcade_edition_sprite_->setX(shake_.origin);
|
||||
arcade_edition_status_ = Status::FINISHED;
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::handleArcadeEditionShaking(float deltaTime) {
|
||||
if (shake_.remaining > 0) {
|
||||
processArcadeEditionShake(deltaTime);
|
||||
@@ -301,17 +223,6 @@ void GameLogo::processShakeEffect(SmartSprite* primary_sprite, SmartSprite* seco
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::processArcadeEditionShake() {
|
||||
if (shake_.counter > 0) {
|
||||
shake_.counter--;
|
||||
} else {
|
||||
shake_.counter = shake_.delay;
|
||||
const auto DISPLACEMENT = calculateShakeDisplacement();
|
||||
arcade_edition_sprite_->setX(shake_.origin + DISPLACEMENT);
|
||||
shake_.remaining--;
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::processArcadeEditionShake(float deltaTime) {
|
||||
// Convertir delay (frames) a tiempo: delay frames = delay * (1000ms/60fps)
|
||||
float delayTime = static_cast<float>(shake_.delay) * (1000.0f / 60.0f);
|
||||
@@ -351,24 +262,11 @@ void GameLogo::playTitleEffects() {
|
||||
Screen::get()->shake();
|
||||
}
|
||||
|
||||
void GameLogo::updateDustSprites() {
|
||||
dust_right_sprite_->update();
|
||||
dust_left_sprite_->update();
|
||||
}
|
||||
|
||||
void GameLogo::updateDustSprites(float deltaTime) {
|
||||
dust_right_sprite_->update(deltaTime);
|
||||
dust_left_sprite_->update(deltaTime);
|
||||
}
|
||||
|
||||
void GameLogo::updatePostFinishedCounter() {
|
||||
if (coffee_crisis_status_ == Status::FINISHED &&
|
||||
arcade_edition_status_ == Status::FINISHED &&
|
||||
post_finished_counter_ > 0) {
|
||||
--post_finished_counter_;
|
||||
}
|
||||
}
|
||||
|
||||
void GameLogo::updatePostFinishedCounter(float deltaTime) {
|
||||
if (coffee_crisis_status_ == Status::FINISHED &&
|
||||
arcade_edition_status_ == Status::FINISHED &&
|
||||
|
||||
Reference in New Issue
Block a user