aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-30 15:36:16 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-30 15:36:16 +0200
commit5d2dfe4daed3a0c0a9f872cc6c3baa4124ea0894 (patch)
tree9f706d2c691ac8e23f0b8d804baca3d80fb9e9bf
parentNorm (diff)
download42-cub3d-5d2dfe4daed3a0c0a9f872cc6c3baa4124ea0894.tar.gz
42-cub3d-5d2dfe4daed3a0c0a9f872cc6c3baa4124ea0894.tar.bz2
42-cub3d-5d2dfe4daed3a0c0a9f872cc6c3baa4124ea0894.tar.xz
42-cub3d-5d2dfe4daed3a0c0a9f872cc6c3baa4124ea0894.tar.zst
42-cub3d-5d2dfe4daed3a0c0a9f872cc6c3baa4124ea0894.zip
Check missing enemy good
Diffstat (limited to '')
-rw-r--r--inc/cub3d_defines.h7
-rw-r--r--inc/cub3d_structs.h7
-rw-r--r--src/ft_check_missing_defines.c22
-rw-r--r--src/ft_get_spawns.c4
4 files changed, 29 insertions, 11 deletions
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h
index 3cee49a..b1c93d8 100644
--- a/inc/cub3d_defines.h
+++ b/inc/cub3d_defines.h
@@ -120,6 +120,10 @@ enum
# define FT_WEAPON_TWO_FIRE_PATH "./media/img/weapons/colt_w_fire.xpm"
# define FT_WEAPON_THREE_PATH "./media/img/weapons/double_b_w.xpm"
# define FT_WEAPON_THREE_FIRE_PATH "./media/img/weapons/double_b_w_fire.xpm"
+# define FT_ENMY_WAIT_PATH "./media/img/tex/crapaud.xpm"
+# define FT_ENMY_WALK_PATH "./media/img/tex/linuz.xpm"
+# define FT_ENMY_FIRE_PATH "./media/img/tex/linus.xpm"
+# define FT_ENMY_DEAD_PATH "./media/img/sprites/wood_chest.xpm"
# define FT_HEAL_PACK_PATH "./media/img/sprites/first_aid.xpm"
# define FT_ZER_PATH "./media/img/hud/zero.xpm"
# define FT_ONE_PATH "./media/img/hud/one.xpm"
@@ -281,6 +285,7 @@ enum
# define FT_ERR_MISS_W_ONE_SPR "weapon one sprite image"
# define FT_ERR_MISS_W_TWO_SPR "weapon two sprite image"
# define FT_ERR_MISS_W_THREE_SPR "weapon three sprite image"
+# define FT_ERR_MISS_ENMY "one or several enemy sprites image"
# define FT_ERR_MISS_NUMBER "number image"
# define FT_ERR_MISS_H_CAPTION "health caption"
# define FT_ERR_MISS_A_CAPTION "ammo caption"
@@ -303,6 +308,6 @@ enum
*/
# define FT_PARSE_END_RET 25
-# define FT_TOTAL_SPRT 13
+# define FT_TOTAL_SPRT 14
# endif
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h
index e2905f2..a5c2bcc 100644
--- a/inc/cub3d_structs.h
+++ b/inc/cub3d_structs.h
@@ -224,6 +224,12 @@ typedef struct s_map
float y_floor_step;
} t_map;
+typedef struct s_bad_boy
+{
+ int8_t life;
+ void (*act[5])(struct s_sprite*, struct s_map*);
+} t_bad_boy;
+
typedef struct s_cub
{
uint8_t w_side;
@@ -270,6 +276,7 @@ typedef struct s_cub
struct s_img tnum[12];
struct s_sprite **sprites;
struct s_sfx sfx[13];
+ struct s_bad_boy *bad_boy;
} t_cub;
# endif
diff --git a/src/ft_check_missing_defines.c b/src/ft_check_missing_defines.c
index bf5bd6d..a25c5ee 100644
--- a/src/ft_check_missing_defines.c
+++ b/src/ft_check_missing_defines.c
@@ -19,8 +19,15 @@ static int
if (ft_check_not_found(FT_INF_PATH) < 0 ||
ft_check_ext(FT_INF_PATH, ".xpm") < 0)
return (ft_missing_error(FT_ERR_MISS_NUMBER, clist));
+ if (ft_check_not_found(FT_CAP_HEALTH_PATH) < 0 ||
+ ft_check_ext(FT_CAP_HEALTH_PATH, ".xpm") < 0)
+ return (ft_missing_error(FT_ERR_MISS_H_CAPTION, clist));
+ if (ft_check_not_found(FT_CAP_AMMO_PATH) < 0 ||
+ ft_check_ext(FT_CAP_AMMO_PATH, ".xpm") < 0)
+ return (ft_missing_error(FT_ERR_MISS_A_CAPTION, clist));
return (ft_check_missing_sfx(clist));
}
+
static int
ft_check_missing_number_defines(t_cub *clist)
{
@@ -53,12 +60,15 @@ static int
static int
ft_check_missing_more_tex_defines(t_cub *clist)
{
- if (ft_check_not_found(FT_CAP_HEALTH_PATH) < 0 ||
- ft_check_ext(FT_CAP_HEALTH_PATH, ".xpm") < 0)
- return (ft_missing_error(FT_ERR_MISS_H_CAPTION, clist));
- if (ft_check_not_found(FT_CAP_AMMO_PATH) < 0 ||
- ft_check_ext(FT_CAP_AMMO_PATH, ".xpm") < 0)
- return (ft_missing_error(FT_ERR_MISS_A_CAPTION, clist));
+ if (ft_check_not_found(FT_ENMY_WAIT_PATH) < 0 ||
+ ft_check_ext(FT_ENMY_WAIT_PATH, ".xpm") < 0 ||
+ ft_check_not_found(FT_ENMY_WALK_PATH) < 0 ||
+ ft_check_ext(FT_ENMY_WALK_PATH, ".xpm") < 0 ||
+ ft_check_not_found(FT_ENMY_FIRE_PATH) < 0 ||
+ ft_check_ext(FT_ENMY_FIRE_PATH, ".xpm") < 0 ||
+ ft_check_not_found(FT_ENMY_DEAD_PATH) < 0 ||
+ ft_check_ext(FT_ENMY_DEAD_PATH, ".xpm") < 0)
+ return (ft_missing_error(FT_ERR_MISS_ENMY, clist))
return (ft_check_missing_number_defines(clist));
}
diff --git a/src/ft_get_spawns.c b/src/ft_get_spawns.c
index 0caedf3..9ac88b8 100644
--- a/src/ft_get_spawns.c
+++ b/src/ft_get_spawns.c
@@ -19,8 +19,4 @@ void
{
ft_get_player_spawn(&cl->plist, cl);
ft_get_sprite_spawn(cl);
- /* ft_get_trap_spawn(cl); */
- /* ft_get_heal_spawn(cl); */
- /* if (cl->isdead == 0) */
- /* ft_get_weapon_spawn(cl); */
}