-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathso_long.h
90 lines (77 loc) · 1.87 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* so_long.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hbaddrul <hbaddrul@student.42kl.edu.my> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/09 16:53:16 by hbaddrul #+# #+# */
/* Updated: 2021/11/13 14:25:22 by hbaddrul ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SO_LONG_H
# define SO_LONG_H
# define BUFFER_SIZE 42
# define ESC 53
# define LEFT 0
# define RIGHT 2
# define DOWN 1
# define UP 13
typedef struct s_xy
{
int x;
int y;
} t_xy;
typedef struct s_player
{
int c;
int moves;
t_xy attempt;
t_xy actual;
} t_player;
typedef struct s_enemy
{
t_xy actual;
} t_enemy;
typedef struct s_map
{
int rows;
int cols;
int c;
int e;
int p;
int v;
int diff_cols;
int px;
char **lines;
} t_map;
typedef struct s_game
{
char **lines;
void *o;
void *c;
void *c2;
void *e;
void *p;
void *p2;
void *p3;
void *v;
void *mlx;
void *win;
t_player player;
t_enemy *enemies;
t_map map;
} t_game;
/* get_next_line.c */
char *get_next_line(int fd);
/* validate.c */
int is_valid_map(char *file, t_map *map);
/* setup.c */
void init_g(t_game *g);
void init_lines_and_images(char *file, t_game *g);
void init_enemies(t_game *g);
void put_images(t_game *g);
/* gameplay.c */
void end_game(t_game *g);
void move(t_game *g);
#endif