}
void
-Sprite::start_animation(int loops)
+Sprite::start_animation(int loops, std::string next_act)
{
-animation_loops = loops;
reset();
+animation_loops = loops;
+if(!next_act.empty())
+ next_action = next_act;
}
void
frame = 0;
last_tick = SDL_GetTicks();
animation_reversed = true;
+next_action.clear();
}
bool
{ // last case can happen when not used reverse_animation()
frame = get_frames() - 1;
if(animation_loops > 0)
+ {
animation_loops--;
+ if(animation_loops == 0)
+ {
+ set_action(next_action);
+ start_animation(-1);
+ }
+ }
if(fabsf(excedent) < get_frames())
frame += excedent;
{
frame = 0;
if(animation_loops > 0)
+ {
animation_loops--;
+ if(animation_loops == 0)
+ {
+ set_action(next_action);
+ start_animation(-1);
+ }
+ }
if(excedent < get_frames())
frame += excedent;