feat: the exit works :D
This commit is contained in:
parent
0e745f82b3
commit
d3c7d8c08f
36 changed files with 3645 additions and 51 deletions
|
|
@ -6,14 +6,14 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/29 17:43:01 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/18 13:54:58 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/18 17:05:31 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef DATA_ASSETS_H
|
||||
# define DATA_ASSETS_H
|
||||
|
||||
# define NB_ASSETS 88
|
||||
# define NB_ASSETS 97
|
||||
|
||||
typedef struct s_assetmeta
|
||||
{
|
||||
|
|
@ -81,6 +81,15 @@ typedef enum e_assetsmap_id
|
|||
OBJECT_EXIT_USING2_5,
|
||||
OBJECT_EXIT_USING2_6,
|
||||
OBJECT_EXIT_USING2_7,
|
||||
OBJECT_EXIT_TP_1,
|
||||
OBJECT_EXIT_TP_2,
|
||||
OBJECT_EXIT_TP_3,
|
||||
OBJECT_EXIT_TP_4,
|
||||
OBJECT_EXIT_TP_5,
|
||||
OBJECT_EXIT_TP_6,
|
||||
OBJECT_EXIT_TP_7,
|
||||
OBJECT_EXIT_TP_8,
|
||||
OBJECT_EXIT_TP_9,
|
||||
OBJECT_FIRSK_DOWN,
|
||||
OBJECT_FIRSK_UP,
|
||||
OBJECT_FIRSK_LEFT,
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/11 15:56:31 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/18 13:59:33 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/18 18:24:20 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef DATA_SPRITES_H
|
||||
# define DATA_SPRITES_H
|
||||
|
||||
# define NB_SPRITES 26
|
||||
# define NB_SPRITES 27
|
||||
|
||||
typedef enum e_spritetype
|
||||
{
|
||||
|
|
@ -51,7 +51,8 @@ typedef enum e_spritesmap_id
|
|||
SPR_KETCHUP_FADE,
|
||||
SPR_EXIT_INACTIVE,
|
||||
SPR_EXIT_ACTIVE,
|
||||
SPR_EXIT_USING,
|
||||
SPR_EXIT_REMAINING,
|
||||
SPR_EXIT_TP,
|
||||
SPR_FIRSK,
|
||||
SPR_FIRSK_WALK_DOWN,
|
||||
SPR_FIRSK_WALK_UP,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/02 13:53:41 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/17 13:48:12 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/18 17:59:26 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -47,6 +47,7 @@
|
|||
# include "room/camera.h"
|
||||
# include "room/pathfinding.h"
|
||||
|
||||
# include "main/levels.h"
|
||||
# include "main/env.h"
|
||||
# include "main/input.h"
|
||||
# include "main/timedloop.h"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/15 18:01:07 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/18 18:21:35 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -20,16 +20,19 @@
|
|||
|
||||
typedef struct s_env
|
||||
{
|
||||
t_memclass mc;
|
||||
void *mlx;
|
||||
void *win;
|
||||
t_room room;
|
||||
bool input[4];
|
||||
int ketchup;
|
||||
int max_ketchup;
|
||||
int moves;
|
||||
t_camera camera;
|
||||
} t_env;
|
||||
t_memclass mc;
|
||||
void *mlx;
|
||||
void *win;
|
||||
t_room room;
|
||||
bool input[4];
|
||||
int ketchup;
|
||||
int max_ketchup;
|
||||
int moves;
|
||||
t_camera camera;
|
||||
t_const_string *levels;
|
||||
int level_count;
|
||||
int level_current;
|
||||
} t_env;
|
||||
|
||||
extern t_env g_env;
|
||||
|
||||
|
|
|
|||
19
includes/main/levels.h
Normal file
19
includes/main/levels.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* levels.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/18 17:45:16 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/18 18:00:50 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef LEVELS_H
|
||||
# define LEVELS_H
|
||||
|
||||
void init_levels(int count, t_const_string *srcs);
|
||||
void win(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/02 17:47:01 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/11 13:54:23 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/18 18:17:16 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -14,10 +14,21 @@
|
|||
# define OBJECTS_H
|
||||
|
||||
// SNAS
|
||||
typedef enum e_snas_state
|
||||
{
|
||||
SNAS_STATE_DEFAULT,
|
||||
SNAS_STATE_GOING_TO_EXIT,
|
||||
SNAS_STATE_DISAPPEARS,
|
||||
SNAS_STATE_WAITING_TO_WIN,
|
||||
} t_snas_state;
|
||||
|
||||
typedef struct s_snas_data
|
||||
{
|
||||
t_character character;
|
||||
} t_snas_data;
|
||||
t_character character;
|
||||
t_snas_state state;
|
||||
t_sprite tp_spr;
|
||||
int wait_before_win;
|
||||
} t_snas_data;
|
||||
|
||||
t_object snas_init(t_memclass mc);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/03 15:34:18 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/11 17:07:59 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/18 17:15:18 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -19,6 +19,6 @@ typedef struct s_visual
|
|||
} t_visual;
|
||||
|
||||
void visual_loop(t_visual **visual, t_point p);
|
||||
void visual_addtoroom(t_spritesmap_id sprid, t_point pos);
|
||||
void visual_addtoroom(t_sprite spr, t_point pos);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue