feat: multi level management *
when called without arguments, use the default levels
This commit is contained in:
parent
a9c292d72b
commit
7b1e519db6
8 changed files with 44 additions and 23 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/19 14:03:49 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/19 14:14:09 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -19,31 +19,34 @@
|
|||
# define FPS 20
|
||||
# define TEXT_SPACE 9
|
||||
|
||||
# define LEVEL_COUNT 3
|
||||
extern const t_const_string g_levels[LEVEL_COUNT];
|
||||
|
||||
typedef struct s_env
|
||||
{
|
||||
// GLOBAL
|
||||
t_memclass mc;
|
||||
t_memclass mc;
|
||||
|
||||
// IO
|
||||
// display
|
||||
void *mlx;
|
||||
void *win;
|
||||
void *mlx;
|
||||
void *win;
|
||||
// input
|
||||
bool input[4];
|
||||
bool enter;
|
||||
bool input[4];
|
||||
bool enter;
|
||||
|
||||
// GAME
|
||||
// levels
|
||||
t_const_string *levels;
|
||||
int level_count;
|
||||
int level_current;
|
||||
const t_const_string *levels;
|
||||
int level_count;
|
||||
int level_current;
|
||||
// room
|
||||
t_room room;
|
||||
t_camera camera;
|
||||
int ketchup;
|
||||
int max_ketchup;
|
||||
t_room room;
|
||||
t_camera camera;
|
||||
int ketchup;
|
||||
int max_ketchup;
|
||||
// moves
|
||||
int moves;
|
||||
int moves;
|
||||
} t_env;
|
||||
|
||||
extern t_env g_env;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/18 17:45:16 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/19 12:48:33 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/19 14:12:07 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
void init_level(void);
|
||||
void ask_retry(bool current);
|
||||
void init_levels(int count, t_const_string *srcs);
|
||||
void init_levels(int count, const t_const_string *srcs);
|
||||
void win(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue