-
Notifications
You must be signed in to change notification settings - Fork 0
/
so_long.h
97 lines (89 loc) · 2.49 KB
/
so_long.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* so_long.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apereira <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/02 12:52:45 by apereira #+# #+# */
/* Updated: 2023/01/20 02:22:04 by apereira ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SO_LONG_H
# define SO_LONG_H
# include "mlx_linux/mlx.h"
# include "GNL/get_next_line.h"
# include <fcntl.h>
typedef struct s_game
{
struct s_img
{
void *zero;
void *one;
void *c;
void *ded;
void *pr;
void *pl;
void *pu;
void *water;
void *open;
void *closed;
void *won;
void *lost;
}t_img;
void *wdw;
void *wdw2;
void *mlx;
char **matriz;
int tall;
int large;
int food;
int p;
int e;
int pixel;
int pixelp;
int p_x;
int p_y;
int pp_x;
int pp_y;
int end_x;
int end_y;
int i;
int j;
int w;
int a;
int s;
int d;
}t_game;
// Utils functions
int ft_strlen(const char *str);
void vars_init(t_game *game);
void imgs_init(t_game *game);
int destroy_wdw(t_game *game);
int open_wdw(t_game *game);
char *ft_strstr(const char *str, const char *word);
void *ft_itoa(int n);
void destroy_images(t_game *game);
// Map validaters
char **map_cpy(int fd, char *argv, t_game *game);
int wall_check(t_game *game);
int check_cpe(char **matriz, t_game *game);
int check_cpe_ifs(char **matriz, t_game *game);
int check_path(int i, int j, t_game *inf);
int check_path_check(char **matriz, t_game *game);
// Animations display and key hooks
int game_start(t_game *game);
int keydown(int key, t_game *game);
int keyup(int key, t_game *game);
void food_collector(t_game *game);
void img_to_window(t_game *game);
void ifs(t_game *game);
int p_move(t_game *game);
int p_move_ifs(t_game *game);
int player_anim(t_game *game);
// Post game display
void exit_check(t_game *game);
void display_victory(t_game game);
void display_loss(t_game game);
void enemy_check(t_game *game);
#endif