diff --git a/Makefile b/Makefile index 6d7fe2c..e408d45 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: adjoly +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/11/01 11:03:22 by adjoly #+# #+# # -# Updated: 2024/01/07 19:32:37 by adjoly ### ########.fr # +# Updated: 2024/01/08 13:33:38 by adjoly ### ########.fr # # # # **************************************************************************** # @@ -14,8 +14,9 @@ NAME = so_long CC = cc -SRCS = main.c \ - ft_move_character.c +SRCS = #main.c \ + #ft_move_character.c \ + get_map.c OBJS = $(SRCS:.c=.o) @@ -38,9 +39,11 @@ $(NAME): $(OBJS) all: $(NAME) clean: + make -C libft clean rm -f $(OBJS) fclean: clean + make -C libft fclean rm -f $(NAME) re: fclean all diff --git a/assets/character.png b/assets/character.png new file mode 100644 index 0000000..3d3a1bc Binary files /dev/null and b/assets/character.png differ diff --git a/assets/ground.png b/assets/ground.png new file mode 100644 index 0000000..ff63997 Binary files /dev/null and b/assets/ground.png differ diff --git a/assets/wall.png b/assets/wall.png new file mode 100644 index 0000000..ceee36c Binary files /dev/null and b/assets/wall.png differ diff --git a/ft_move_character.c b/ft_move_character.c index 3073b73..3cc42cc 100644 --- a/ft_move_character.c +++ b/ft_move_character.c @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/07 19:13:01 by adjoly #+# #+# */ -/* Updated: 2024/01/07 22:37:53 by adjoly ### ########.fr */ +/* Updated: 2024/01/08 13:24:49 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,7 @@ int ft_move_left(void *param) int ft_move_right(void *param) { - + } int ft_move_character(int key, void *param) @@ -42,6 +42,5 @@ int ft_move_character(int key, void *param) ft_move_right(param); else if (key == 7) ft_move_left(param); - ft_putnbr_fd(key, 1); return (0); } diff --git a/get_map.c b/get_map.c new file mode 100644 index 0000000..21d91d3 --- /dev/null +++ b/get_map.c @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* get_map.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/01/08 13:13:18 by adjoly #+# #+# */ +/* Updated: 2024/01/08 13:22:56 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "so_long.h" + +int ft_countline_fd(int fd) +{ + size_t line_count; + ssize_t rd; + + + while () + { + + } + + return (line_count); +} + +char **ft_read_map(char *file_name) +{ + char **map_read; + int fd; + + map_read = ft_countline_fd(fd); + + return +} diff --git a/main.c b/main.c index 222ddc5..9e0bbfd 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/06 16:18:56 by adjoly #+# #+# */ -/* Updated: 2024/01/07 19:12:34 by adjoly ### ########.fr */ +/* Updated: 2024/01/08 13:09:20 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -54,5 +54,6 @@ int main(int ac, char **av) mlx_loop(win->mlx); mlx_destroy_window(win->mlx, win->win); mlx_destroy_display(win->mlx); + free(win); return (0); } diff --git a/main.o b/main.o index 7f1c988..aab4d96 100644 Binary files a/main.o and b/main.o differ diff --git a/so_long.h b/so_long.h index b43a93c..60fa634 100644 --- a/so_long.h +++ b/so_long.h @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/06 16:19:42 by adjoly #+# #+# */ -/* Updated: 2024/01/07 19:24:27 by adjoly ### ########.fr */ +/* Updated: 2024/01/08 13:32:18 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,6 +15,9 @@ # include "MacroLibX/includes/mlx.h" # include "libft/libft.h" +# include +# include +# include typedef struct s_window {