/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* 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++; } }