Añadidos enemigos tipo path
This commit is contained in:
@@ -3,7 +3,7 @@ frame_width=16
|
|||||||
frame_height=16
|
frame_height=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=walk
|
name=default
|
||||||
speed=8
|
speed=8
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5
|
frames=0,1,2,3,4,5
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ frame_width=16
|
|||||||
frame_height=16
|
frame_height=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=walk
|
name=default
|
||||||
speed=8
|
speed=8
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5
|
frames=0,1,2,3,4,5
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ frame_width=16
|
|||||||
frame_height=16
|
frame_height=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=walk
|
name=default
|
||||||
speed=6
|
speed=6
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5
|
frames=0,1,2,3,4,5
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ frame_width=16
|
|||||||
frame_height=16
|
frame_height=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=walk
|
name=default
|
||||||
speed=8
|
speed=8
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,1,2,3,4,5
|
frames=0,1,2,3,4,5
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ AnimatedSprite::~AnimatedSprite()
|
|||||||
// Obtiene el indice de la animación a partir del nombre
|
// Obtiene el indice de la animación a partir del nombre
|
||||||
int AnimatedSprite::getIndex(std::string name)
|
int AnimatedSprite::getIndex(std::string name)
|
||||||
{
|
{
|
||||||
int result = -1;
|
int index = 0;
|
||||||
for (int i = 0; i < animation.size(); i++)
|
for (int i = 0; i < animation.size(); i++)
|
||||||
{
|
{
|
||||||
if (animation[i].name == name)
|
if (animation[i].name == name)
|
||||||
{
|
{
|
||||||
result = i;
|
index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calcula el frame correspondiente a la animación
|
// Calcula el frame correspondiente a la animación
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ bool EnemyEngine::load(std::string file_path)
|
|||||||
|
|
||||||
printf("** enemy path loaded\n\n");
|
printf("** enemy path loaded\n\n");
|
||||||
//enemies.push_back(new EnemyPath(enemy, p1, p2));
|
//enemies.push_back(new EnemyPath(enemy, p1, p2));
|
||||||
enemy = new EnemyPath(enemy, p1, p2);
|
this->enemy = new EnemyPath(enemy, p1, p2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user