Ja es mouen els sprites en hiscore_table.cpp, falta decidir-se per un disseny concret

This commit is contained in:
2025-01-25 22:57:49 +01:00
parent 52a0c2b91f
commit bad0a10328
3 changed files with 89 additions and 7 deletions

View File

@@ -96,7 +96,7 @@ void PathSprite::addPath(std::vector<SDL_Point> spots, int waiting_counter)
// Habilita el objeto
void PathSprite::enable()
{
if (paths_.size() == 0)
if (paths_.size() == 0 || enabled_)
{
return;
}
@@ -133,9 +133,13 @@ void PathSprite::moveThroughCurrentPath()
if (path.on_destination)
{
if (path.waiting_counter == 0)
{
path.finished = true;
}
else
{
--path.waiting_counter;
}
}
}
@@ -144,11 +148,15 @@ void PathSprite::goToNextPathOrDie()
{
// Comprueba si ha terminado el recorrdo actual
if (paths_.at(current_path_).finished)
{
++current_path_;
}
// Comprueba si quedan mas recorridos
if (current_path_ >= static_cast<int>(paths_.size()))
{
enabled_ = false;
}
}
// Indica si ha terminado todos los recorridos