diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-30 16:50:13 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-30 16:50:13 +0200 |
commit | c8e12617e07762d65bc7c74ecc55e279c3267b84 (patch) | |
tree | 2114b7906acdef1d5d5f2c580c62d612bf4819ca /src/ft_init_bad_boys.c | |
parent | Fixed conditionnal jump btw (diff) | |
download | 42-cub3d-c8e12617e07762d65bc7c74ecc55e279c3267b84.tar.gz 42-cub3d-c8e12617e07762d65bc7c74ecc55e279c3267b84.tar.bz2 42-cub3d-c8e12617e07762d65bc7c74ecc55e279c3267b84.tar.xz 42-cub3d-c8e12617e07762d65bc7c74ecc55e279c3267b84.tar.zst 42-cub3d-c8e12617e07762d65bc7c74ecc55e279c3267b84.zip |
Commit
Diffstat (limited to 'src/ft_init_bad_boys.c')
-rw-r--r-- | src/ft_init_bad_boys.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ft_init_bad_boys.c b/src/ft_init_bad_boys.c new file mode 100644 index 0000000..8ddc9a5 --- /dev/null +++ b/src/ft_init_bad_boys.c @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_init_bad_boys.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:51 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:51 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <cub3d.h> +#include <stdint.h> +#include <stdlib.h> + +int8_t + ft_init_bad_boys(t_cub *cl) +{ + int8_t i; + + if (!(cl->bad_boy = (t_bad_boy*)malloc(cl->mlist.sprite_nbr[13] + * sizeof(t_bad_boy)))) + return (ft_alloc_error(cl)); + i = 0; + while (i < cl->mlist.sprite_nbr[13]) + { + cl->bad_boy[i].life = 5; + cl->bad_boy[i].does = 0; + cl->bad_boy[i].act[0] = ft_bb_wait; + cl->bad_boy[i].act[1] = ft_bb_walk; + cl->bad_boy[i].act[2] = ft_bb_fire; + i++; + } + return (0); +} |