diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_suffer_animation.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/ft_suffer_animation.c b/src/ft_suffer_animation.c index 1b48e47..d813348 100644 --- a/src/ft_suffer_animation.c +++ b/src/ft_suffer_animation.c @@ -16,9 +16,9 @@ #include <stdint.h> static void - ft_get_damaged(t_cub *cl) + ft_get_damaged(uint16_t dmg, t_cub *cl) { - cl->plist.life -= FT_TRAP_DAMAGE_AMOUNT; + cl->plist.life -= dmg; if (cl->plist.life <= 0) { cl->isdead = 1; @@ -27,13 +27,12 @@ static void } else { - cl->sfx[4].sfx_play(cl->sfx); cl->sfx[3].sfx_play(cl->sfx); } } void - ft_linux_suffer_animation(t_cub *cl) + ft_linux_suffer_animation(uint16_t dmg, t_cub *cl) { int32_t x; int32_t y; @@ -53,11 +52,11 @@ void mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, cl->img.img, 0, 0); mlx_destroy_image(cl->wlist.wlx, cl->img.img); - ft_get_damaged(cl); + ft_get_damaged(dmg, cl); } void - ft_macos_suffer_animation(t_cub *cl) + ft_macos_suffer_animation(uint16_t dmg, t_cub *cl) { int32_t x; int32_t y; @@ -78,6 +77,6 @@ void (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(0, rgb, cl); } } - ft_get_damaged(cl); + ft_get_damaged(dmg, cl); cl->doicast = 0; } |