aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_suffer_animation.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-30 21:16:48 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-30 21:16:48 +0200
commit14b08c7f6a5fc0efa61af63ef651fd444b00b697 (patch)
treeb8b0f72d26d615f7cc5e6c3c6e7fa96a593753a3 /src/ft_suffer_animation.c
parentFine (diff)
download42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.gz
42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.bz2
42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.xz
42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.zst
42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.zip
Nigga be shootin' quick af
Diffstat (limited to '')
-rw-r--r--src/ft_suffer_animation.c13
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;
}