feat: add exit (without game over screen) *

also:
- fix: walk_through's prototype
- misc: remove ketchup debug thing
- dev: rename room_patch -> room_fromfile3
This commit is contained in:
mcolonna 2024-04-08 15:37:47 +02:00
parent 6ad613d4bb
commit 7ec3eb6841
16 changed files with 103 additions and 23 deletions

View file

@ -6,14 +6,14 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/11 15:56:31 by mcolonna #+# #+# */
/* Updated: 2024/04/05 18:01:55 by mcolonna ### ########.fr */
/* Updated: 2024/04/08 15:30:53 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_SPRITES_H
# define DATA_SPRITES_H
# define NB_SPRITES 11
# define NB_SPRITES 14
typedef enum e_spritetype
{
@ -47,6 +47,9 @@ typedef enum e_spritesmap_id
SPR_WALL,
SPR_KETCHUP,
SPR_KETCHUP_FADE,
SPR_EXIT_INACTIVE,
SPR_EXIT_ACTIVE,
SPR_EXIT_USING,
} t_spritesmap_id;
#endif

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
/* Updated: 2024/04/05 16:31:40 by mcolonna ### ########.fr */
/* Updated: 2024/04/08 15:17:26 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -27,6 +27,7 @@ typedef struct s_env
t_room room;
bool input[4];
int ketchup;
int max_ketchup;
} t_env;
extern t_env g_env;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 14:58:25 by mcolonna #+# #+# */
/* Updated: 2024/04/03 16:11:55 by mcolonna ### ########.fr */
/* Updated: 2024/04/08 15:35:33 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -23,7 +23,7 @@ typedef struct s_objecttype
// Called when a character want to walk through this object.
// Returns false to block the character. If true, it will pass.
// If walk_through is NULL, the character is blocked.
bool (*walk_through)(t_character *, t_point pos);
bool (*walk_through)(t_object *, t_character *, t_point pos);
} t_objecttype;
typedef struct s_object

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/02 17:47:01 by mcolonna #+# #+# */
/* Updated: 2024/04/03 15:25:31 by mcolonna ### ########.fr */
/* Updated: 2024/04/08 15:22:05 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,4 +37,13 @@ typedef struct s_ketchup_data
t_object ketchup_init(t_memclass mc);
// EXIT
typedef struct s_exit_data
{
t_sprite spr;
bool active;
} t_exit_data;
t_object exit_init(t_memclass mc);
#endif

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/07 23:00:45 by mcolonna #+# #+# */
/* Updated: 2024/04/03 15:32:23 by mcolonna ### ########.fr */
/* Updated: 2024/04/08 15:17:12 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */