Archived
1
0

started get map

This commit is contained in:
Adam Joly
2024-01-08 13:33:55 +01:00
parent b04a3e73e3
commit f33d52e643
9 changed files with 51 additions and 8 deletions

View File

@ -6,7 +6,7 @@
# By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ # # By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/11/01 11:03:22 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 CC = cc
SRCS = main.c \ SRCS = #main.c \
ft_move_character.c #ft_move_character.c \
get_map.c
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)
@ -38,9 +39,11 @@ $(NAME): $(OBJS)
all: $(NAME) all: $(NAME)
clean: clean:
make -C libft clean
rm -f $(OBJS) rm -f $(OBJS)
fclean: clean fclean: clean
make -C libft fclean
rm -f $(NAME) rm -f $(NAME)
re: fclean all re: fclean all

BIN
assets/character.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

BIN
assets/ground.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

BIN
assets/wall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/07 19:13:01 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 */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -42,6 +42,5 @@ int ft_move_character(int key, void *param)
ft_move_right(param); ft_move_right(param);
else if (key == 7) else if (key == 7)
ft_move_left(param); ft_move_left(param);
ft_putnbr_fd(key, 1);
return (0); return (0);
} }

37
get_map.c Normal file
View File

@ -0,0 +1,37 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_map.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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
}

3
main.c
View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/06 16:18:56 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_loop(win->mlx);
mlx_destroy_window(win->mlx, win->win); mlx_destroy_window(win->mlx, win->win);
mlx_destroy_display(win->mlx); mlx_destroy_display(win->mlx);
free(win);
return (0); return (0);
} }

BIN
main.o

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/06 16:19:42 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 "MacroLibX/includes/mlx.h"
# include "libft/libft.h" # include "libft/libft.h"
# include <unistd.h>
# include <fcntl.h>
# include <stdlib.h>
typedef struct s_window typedef struct s_window
{ {