aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ft_bad_boy_actions.c1
-rw-r--r--src/ft_damage_bad_boy.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/src/ft_bad_boy_actions.c b/src/ft_bad_boy_actions.c
index c2324bd..d56037e 100644
--- a/src/ft_bad_boy_actions.c
+++ b/src/ft_bad_boy_actions.c
@@ -72,6 +72,7 @@ void
if (cl->bad_boy[i].does == 2 && cl->bad_boy[i].sleep == 0)
{
cl->sfx[11].sfx_play(cl->sfx);
+ /* TODO: true bad boy sfx here */
if (FT_OS == 1)
ft_macos_suffer_animation(FT_ENMY_DAMAGE_AMOUNT, cl);
else
diff --git a/src/ft_damage_bad_boy.c b/src/ft_damage_bad_boy.c
index b6eb7df..c9cb66c 100644
--- a/src/ft_damage_bad_boy.c
+++ b/src/ft_damage_bad_boy.c
@@ -12,6 +12,7 @@
#include <libft.h>
#include <cub3d.h>
+#include <math.h>
static uint8_t
ft_get_bad_boy_id(t_cub *cl)
@@ -21,12 +22,12 @@ static uint8_t
i = 0;
while (i < cl->mlist.sprite_nbr[13])
{
- if (cl->sprites[13][i].s_pos_x == cl->rlist.sqy &&
- cl->sprites[13][i].s_pos_y == cl->rlist.sqx)
- return (i);
+ if (lround(cl->sprites[13][i].s_pos_x) == (long)cl->rlist.sqy &&
+ lround(cl->sprites[13][i].s_pos_y) == (long)cl->rlist.sqx)
+ break ;
i++;
}
- return (0);
+ return (i);
}
void
@@ -41,6 +42,5 @@ void
cl->bad_boy[id].life -= FT_W_TWO_DANAGE_AMOUNT;
else if (cl->plist.handles_weapon == 4)
cl->bad_boy[id].life -= FT_W_THREE_DANAGE_AMOUNT;
- ft_printf("%hhd\n", cl->bad_boy[0].life);
/* TODO: sfx enemy scream and death */
}