-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathso_long.h
More file actions
99 lines (93 loc) · 2.86 KB
/
so_long.h
File metadata and controls
99 lines (93 loc) · 2.86 KB
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
98
99
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* so_long.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ldiaz-ra <ldiaz-ra@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/14 14:27:44 by ldiaz-ra #+# #+# */
/* Updated: 2023/11/28 15:21:33 by ldiaz-ra ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SO_LONG_H
# define SO_LONG_H
# include "mlx/mlx.h"
# include "Libft/libft.h"
# include <stdio.h>
# include <stdlib.h>
# include <fcntl.h>
# include <unistd.h>
# define ROJO_T "\x1b[31m"
# define RESET_COLOR "\x1b[0m"
# define BUFFER_SIZE 1000
# define WIDTH 128
# define HEIGHT 128
# define EXTENSION ".ber"
# define TOP 13
# define BOTTOM 1
# define LEFT 0
# define RIGHT 2
# define ON_DESTROY 17
# define MURO "./textures/muro.xpm"
# define CESPED "./textures/cesped.xpm"
# define PER_B "./textures/MarioB.xpm"
# define PER_B1 "./textures/MarioB1.xpm"
# define PER_L "./textures/MarioL.xpm"
# define PER_L1 "./textures/MarioL1.xpm"
# define PER_R "./textures/MarioR.xpm"
# define PER_R1 "./textures/MarioR1.xpm"
# define PER_T "./textures/MarioT.xpm"
# define PER_T1 "./textures/MarioT1.xpm"
# define PUERTA "./textures/puerta.xpm"
# define COIN "./textures/coin.xpm"
typedef struct s_game t_game;
typedef struct s_vars t_vars;
typedef struct s_game
{
int coins;
int colle;
int steps;
int exits;
int person;
int img_width;
int img_height;
int frame;
int priority;
char *map;
char *img_p;
char **map_array;
char **map_copy;
void *img;
size_t map_x_len;
size_t map_y_len;
size_t p_y;
size_t p_x;
size_t x;
size_t y;
t_vars *vars;
} t_game;
typedef struct s_vars {
void *mlx;
void *win;
t_game *game;
} t_vars;
void init(t_game *game, char *name_map);
void coor_person(t_game *game, size_t y, size_t x);
void ft_error(char *error);
void get_screen(t_vars *vars, t_game *game);
void move_top(t_vars *vars);
void move_left(t_vars *vars);
void move_right(t_vars *vars);
void move_bottom(t_vars *vars);
void print_count(t_game *game);
void check_object(t_game *game);
void *image(t_game *game, char c);
void ft_error(char *error);
void check_char(char c);
int print_map(t_game *game);
int animation(t_game *game);
int collected(t_vars *vars);
int ft_close(t_vars *vars);
int ft_close(t_vars *vars);
char **free_matrix(char **memory);
#endif