fix: el temporitzador del tabe continuava contant amb el joc en pausa
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user