Retocado el mapa

This commit is contained in:
2022-08-27 23:26:48 +02:00
parent 7c7e0c01e2
commit bc464206c1
9 changed files with 91 additions and 49 deletions

View File

@@ -28,7 +28,7 @@ AnimatedSprite::~AnimatedSprite()
// Obtiene el indice de la animación a partir del nombre
int AnimatedSprite::getIndex(std::string name)
{
int index = 0;
int index = -1;
for (int i = 0; i < animation.size(); i++)
{
if (animation[i].name == name)
@@ -36,6 +36,12 @@ int AnimatedSprite::getIndex(std::string name)
index = i;
}
}
if (index == -1)
{
printf("** Warning: could not find \"%s\" animation\n", name.c_str());
index = 0;
}
return index;
}