forked from jaildesigner-jailgames/coffee_crisis
v1.4
This commit is contained in:
@@ -24,6 +24,7 @@ void AnimatedSprite::init(LTexture *texture, SDL_Renderer *renderer)
|
||||
mAnimation[i].numFrames = 0;
|
||||
mAnimation[i].speed = 0;
|
||||
mAnimation[i].loop = true;
|
||||
mAnimation[i].completed = false;
|
||||
for (Uint8 j = 0; i < 20; i++)
|
||||
{
|
||||
mAnimation[i].frames[j].x = 0;
|
||||
@@ -105,6 +106,18 @@ void AnimatedSprite::setAnimationLoop(Uint8 index, bool loop)
|
||||
mAnimation[index].loop = loop;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void AnimatedSprite::setCompleted(Uint8 index, bool value)
|
||||
{
|
||||
mAnimation[index].completed = value;
|
||||
}
|
||||
|
||||
// Comprueba si ha terminado la animación
|
||||
bool AnimatedSprite::isCompleted(Uint8 index)
|
||||
{
|
||||
return mAnimation[index].completed;
|
||||
}
|
||||
|
||||
// Devuelve el rectangulo de una animación y frame concreto
|
||||
SDL_Rect AnimatedSprite::getAnimationClip(Uint8 index_animation, Uint8 index_frame)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user