From df8d32e84a60558c38a0d75496c82de657103648 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 30 Mar 2020 17:46:28 +0200 Subject: It's moving! --- src/ft_select_bad_boy_action.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/ft_select_bad_boy_action.c (limited to 'src/ft_select_bad_boy_action.c') diff --git a/src/ft_select_bad_boy_action.c b/src/ft_select_bad_boy_action.c new file mode 100644 index 0000000..6b3d2ef --- /dev/null +++ b/src/ft_select_bad_boy_action.c @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_select_bad_boy_actions.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:51 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:51 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include + +void + ft_select_bad_boy_action(t_cub *cl) +{ + int8_t i; + int8_t r; + + i = 0; + while (i < cl->mlist.sprite_nbr[13]) + { + if (cl->bad_boy[i].sleep == 0 && cl->bad_boy[i].life > 0) + { + r = rand() % 2; + cl->bad_boy[i].act[r](&cl->bad_boy[i], + &cl->sprites[13][i], &cl->mlist); + cl->bad_boy[i].sleep = 1; + } + i++; + } +} -- cgit v1.2.3