fix: el temporitzador del tabe continuava contant amb el joc en pausa

This commit is contained in:
2025-07-19 13:25:44 +02:00
parent 2d1738f20a
commit 18ca6bdf86
3 changed files with 35 additions and 8 deletions

View File

@@ -20,11 +20,12 @@ Tabe::Tabe()
// Actualiza la lógica
void Tabe::update() {
if (enabled_) {
if (enabled_ && !timer_.is_paused) {
sprite_->update();
move();
updateState();
}
timer_.update();
if (timer_.should_spawn()) {
enable();
@@ -192,4 +193,9 @@ void Tabe::updateTimer() {
void Tabe::disable() {
enabled_ = false;
timer_.reset();
}
// Detiene/activa el timer
void Tabe::pauseTimer(bool value) {
timer_.setPaused(value);
}