Trabajando en las colisiones con los enemigos

This commit is contained in:
2022-09-23 19:50:40 +02:00
parent eac0236c60
commit 48f84d28bd
21 changed files with 196 additions and 344 deletions

View File

@@ -57,7 +57,7 @@ void AnimatedSprite::animate()
// Si alcanza el final de la animación, reinicia el contador de la animación
// en función de la variable loop y coloca el nuevo frame
if (animation[currentAnimation].currentFrame >= animation[currentAnimation].frames.size())
if (animation[currentAnimation].currentFrame >= (int)animation[currentAnimation].frames.size())
{
if (animation[currentAnimation].loop == -1)
{ // Si no hay loop, deja el último frame
@@ -85,7 +85,7 @@ void AnimatedSprite::animate()
void AnimatedSprite::setCurrentFrame(int num)
{
// Descarta valores fuera de rango
if (num >= animation[currentAnimation].frames.size())
if (num >= (int)animation[currentAnimation].frames.size())
{
num = 0;
}
@@ -170,7 +170,7 @@ bool AnimatedSprite::load(std::string filePath)
int pos = line.find("=");
// Procesa las dos subcadenas
if (pos != line.npos)
if (pos != (int)line.npos)
{
if (line.substr(0, pos) == "name")
{
@@ -217,7 +217,7 @@ bool AnimatedSprite::load(std::string filePath)
int pos = line.find("=");
// Procesa las dos subcadenas
if (pos != line.npos)
if (pos != (int)line.npos)
{
if (line.substr(0, pos) == "frames_per_row")
{