feat: add some ketchup *

also fix the 4th ketchup still image
This commit is contained in:
mcolonna 2024-04-03 14:49:35 +02:00
parent a7deecf072
commit ea59cdd8a6
22 changed files with 733 additions and 556 deletions

View file

@ -6,28 +6,30 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/11 15:56:31 by mcolonna #+# #+# */
/* Updated: 2024/04/02 17:38:37 by mcolonna ### ########.fr */
/* Updated: 2024/04/03 15:53:40 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_SPRITES_H
# define DATA_SPRITES_H
# define NB_SPRITES 9
# define NB_SPRITES 11
typedef enum e_spritetype
{
ANIMATION, // loops through all the sprites
ANIMATION_ONCE, // loops through all the sprites but only once
CHARACTER_STILL, // down up left and right positions
} t_spritetype;
typedef struct s_spritemeta
{
t_assetsmap_id first_frame;
int nb_frames;
int origin_x;
int origin_y;
t_spritetype type;
int nb_frames;
int delay_frame;
} t_spritemeta;
extern const t_spritemeta g_spritesmap[NB_SPRITES];
@ -43,6 +45,8 @@ typedef enum e_spritesmap_id
SPR_SNAS_LEFT,
SPR_SNAS_RIGHT,
SPR_WALL,
SPR_KETCHUP,
SPR_KETCHUP_FADE,
} t_spritesmap_id;
#endif

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/07 22:13:20 by mcolonna #+# #+# */
/* Updated: 2024/04/02 17:37:12 by mcolonna ### ########.fr */
/* Updated: 2024/04/03 15:56:22 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,7 +21,8 @@ typedef struct s_sprite
t_sprite sprite_init(t_spritesmap_id spr);
void sprite_draw(int x, int y, t_sprite *spr);
// Return false only if the image drawn was the last (end of the animation).
bool sprite_draw(int x, int y, t_sprite *spr);
void sprite_character_set_direction(t_sprite *spr, t_direction value);