diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/so_long.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/include/so_long.h b/include/so_long.h index d66e355..ce481ef 100644 --- a/include/so_long.h +++ b/include/so_long.h @@ -6,16 +6,28 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/08 14:14:02 by dkaiser #+# #+# */ -/* Updated: 2024/05/10 12:24:12 by dkaiser ### ########.fr */ +/* Updated: 2024/05/10 14:55:46 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef SO_LONG_H # define SO_LONG_H -# define PLAYER_MOVE_SPEED 250 # include "MLX42/MLX42.h" # include "libft.h" +# include "unistd.h" +# include "fcntl.h" + +# define PLAYER_MOVE_SPEED 250 + +enum e_tile +{ + EMPTY = '0', + WALL = '1', + COLLECTIBLE = 'C', + EXIT = 'E', + PLAYER_START = 'P' +}; enum e_direction { @@ -32,6 +44,12 @@ typedef struct s_vector double y; } t_vector; +typedef struct s_ivector +{ + int x; + int y; +} t_ivector; + typedef struct s_player { t_vector position; @@ -40,6 +58,13 @@ typedef struct s_player mlx_image_t *img; } t_player; +typedef struct s_tilemap +{ + t_ivector grid_size; + t_ivector tile_size; + char **tiles; +} t_tilemap; + typedef struct s_game { mlx_t *mlx; @@ -49,7 +74,7 @@ typedef struct s_game } t_game; int init(t_game *game); -void loop(void *game); +void loop(void *params); int draw(t_game *game); void on_key_input(mlx_key_data_t event, void *params); |
