migrat Game, Player i Item a time based

This commit is contained in:
2025-10-28 10:52:13 +01:00
parent 9e8c5e13df
commit 31c84f9676
8 changed files with 190 additions and 153 deletions

View File

@@ -471,13 +471,13 @@ void Room::renderItems() {
}
// Actualiza las variables y objetos de la habitación
void Room::update() {
void Room::update(float delta_time) {
if (is_paused_) {
// Si está en modo pausa no se actualiza nada
return;
}
// Actualiza el contador
// Actualiza el contador (mantenido para compatibilidad temporalmente)
counter_++;
// Actualiza los tiles animados
@@ -490,7 +490,7 @@ void Room::update() {
for (const auto& item : items_) {
// Actualiza los items
item->update();
item->update(delta_time);
}
}

View File

@@ -192,7 +192,7 @@ class Room {
void renderItems();
// Actualiza las variables y objetos de la habitación
void update();
void update(float delta_time);
// Devuelve la cadena del fichero de la habitación contigua segun el borde
auto getRoom(RoomBorder border) -> std::string;