Compare commits
2 Commits
b66f8d6f5a
...
7d7de10b7a
Author | SHA1 | Date | |
---|---|---|---|
|
7d7de10b7a | ||
|
1efd8e1a7b |
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/01/16 12:52:30 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/16 18:46:55 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -28,7 +28,7 @@ static void *ft_char2img(t_data *data, char c)
|
||||
return (data->assets[data->nb_swaps + 3 % NB_COLORS]);
|
||||
if (c == 'P')
|
||||
return (data->assets[data->nb_swaps + 4 % NB_COLORS]);
|
||||
if (c == 'B' && BONUS)
|
||||
if (c == 'B')
|
||||
return (data->assets[data->nb_swaps + 5 % NB_COLORS]);
|
||||
return (NULL);
|
||||
}
|
||||
@ -37,8 +37,6 @@ static void ft_draw_foots(t_data *data)
|
||||
{
|
||||
char *foots;
|
||||
|
||||
if (BONUS)
|
||||
{
|
||||
data->nb_foots++;
|
||||
foots = ft_itoa(data->nb_foots);
|
||||
if (foots == NULL)
|
||||
@ -49,7 +47,6 @@ static void ft_draw_foots(t_data *data)
|
||||
mlx_string_put(data->mlx, data->window, 10, 10, 255, foots);
|
||||
ft_printf("\r%s", foots);
|
||||
free(foots);
|
||||
}
|
||||
}
|
||||
|
||||
int ft_draw_map(t_data *data)
|
||||
@ -59,7 +56,6 @@ int ft_draw_map(t_data *data)
|
||||
void *img;
|
||||
|
||||
ft_fill_pos(data->map);
|
||||
if (BONUS)
|
||||
data->nb_swaps = ++data->nb_swaps % NB_COLORS;
|
||||
patern = ft_get_player_map(*data->map);
|
||||
if (patern == NULL)
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/12 17:20:17 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/01/13 18:50:00 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/16 18:47:20 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -29,8 +29,6 @@ int ft_initialised(char *path, t_data *data)
|
||||
data->map = map;
|
||||
data->window = mlx_new_window(data->mlx, WINDOW_SIZE, WINDOW_SIZE, "long");
|
||||
data->nb_foots = 0;
|
||||
data->nb_swaps = 35;
|
||||
if (BONUS)
|
||||
data->nb_swaps = ft_random_generator(0, NB_COLORS);
|
||||
ft_draw_map(data);
|
||||
mlx_hook(data->window, 17, (0L), ft_exit, data);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/01/05 20:14:44 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/01/13 15:47:42 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/16 18:48:43 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -43,9 +43,7 @@ int ft_test_map_content1(t_map *map)
|
||||
x = 0;
|
||||
while (x < map->x_len)
|
||||
{
|
||||
if (!BONUS && ft_is_in("01CEP", map->patern[y][x]) == 0)
|
||||
return (0);
|
||||
if (BONUS && ft_is_in("01CEPB", map->patern[y][x]) == 0)
|
||||
if (ft_is_in("01CEPB", map->patern[y][x]) == 0)
|
||||
return (0);
|
||||
if (map->patern[y][x] == 'C')
|
||||
nb_collectable++;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/01/12 16:17:20 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/01/13 16:28:34 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/16 18:48:20 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -14,14 +14,8 @@
|
||||
|
||||
static void ft_collector(char **patern, size_t x, size_t y)
|
||||
{
|
||||
if (BONUS)
|
||||
{
|
||||
if (ft_is_in("1B", patern[y][x]))
|
||||
return ;
|
||||
}
|
||||
else
|
||||
if (patern[y][x] == '1')
|
||||
return ;
|
||||
patern[y][x] = '1';
|
||||
ft_collector(patern, x, y - 1);
|
||||
ft_collector(patern, x + 1, y);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/01/04 16:20:03 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/01/16 18:36:10 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/01/16 18:47:59 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -64,4 +64,5 @@ int ft_draw_map(t_data *data);
|
||||
char *name_generator(t_square square);
|
||||
int ft_color_changer(t_data *data);
|
||||
void ft_draw_img(t_data *data, void *img, size_t x, size_t y);
|
||||
int ft_map_is_correct(t_map *map);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user