Compare commits

..

2 Commits

2 changed files with 11 additions and 11 deletions

View File

@ -42,15 +42,15 @@ void animation_system_update(component_t *component)
system_data->actual_frame = system_data->actual_frame->prev; system_data->actual_frame = system_data->actual_frame->prev;
system_data->actual_frame_nb--; system_data->actual_frame_nb--;
} }
else if(!system_data->loop) else if(system_data->loop)
{
system_data->play = false;
}
else
{ {
system_data->actual_frame = system_data->frames.last; system_data->actual_frame = system_data->frames.last;
system_data->actual_frame_nb = system_data->frames.size - 1; system_data->actual_frame_nb = system_data->frames.size - 1;
} }
else
{
system_data->play = false;
}
} }
else else
{ {
@ -59,15 +59,15 @@ void animation_system_update(component_t *component)
system_data->actual_frame = system_data->actual_frame->next; system_data->actual_frame = system_data->actual_frame->next;
system_data->actual_frame_nb++; system_data->actual_frame_nb++;
} }
else if(!system_data->loop) else if(system_data->loop)
{
system_data->play = false;
}
else
{ {
system_data->actual_frame = system_data->frames.first; system_data->actual_frame = system_data->frames.first;
system_data->actual_frame_nb = 0; system_data->actual_frame_nb = 0;
} }
else
{
system_data->play = false;
}
} }
} }

View File

@ -7,7 +7,7 @@
#include "animation_system.h" #include "animation_system.h"
#define PLAYER_DEFAULT_SPEED 80.0f // px / s #define PLAYER_DEFAULT_SPEED 80.0f // px / s
#define PLAYER_DEFAULT_IDLE_ANIMATION_SPEED 250.0f // ms / frame #define PLAYER_DEFAULT_IDLE_ANIMATION_SPEED 500.0f // ms / frame
#define PLAYER_DEFAULT_WALK_ANIMATION_SPEED 160.0f // ms / frame #define PLAYER_DEFAULT_WALK_ANIMATION_SPEED 160.0f // ms / frame
typedef enum player_state_t { typedef enum player_state_t {