Ja es mouen els sprites en hiscore_table.cpp, falta decidir-se per un disseny concret
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user