This function is used to initialize the animation.
dg_animation_t *dg_animation_create(dg_spritesheet_t *sheet, float speed);
dg_animation_t *animation = dg_animation_create(sheet, 2);
dg_animation_t *dg_animation_create(dg_spritesheet_t *sheet, float speed)
{
dg_animation_t *animation = malloc(sizeof(dg_animation_t));
if (!animation)
return 0;
animation->sheet = sheet;
animation->speed = speed;
animation->frames = 0;
animation->size = 0;
return animation;
}