deff bonus pas bonus

This commit is contained in:
Camille Chauvet 2023-01-13 18:37:30 +01:00
parent 2a8ffb82a2
commit 66f7fb04b2
3 changed files with 8 additions and 5 deletions

5
draw.c
View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
/* Updated: 2023/01/13 16:04:19 by cchauvet ### ########.fr */
/* Updated: 2023/01/13 18:34:28 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -58,7 +58,8 @@ int ft_draw_map(t_data *data)
void *img;
ft_fill_pos(data->map);
data->nb_swaps = ++data->nb_swaps % (NB_COLORS - 6);
if (BONUS)
data->nb_swaps++;
patern = ft_get_player_map(*data->map);
if (patern == NULL)
return (1);

4
main.c
View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/12 17:20:17 by cchauvet #+# #+# */
/* Updated: 2023/01/13 15:44:38 by cchauvet ### ########.fr */
/* Updated: 2023/01/13 18:35:20 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -29,6 +29,8 @@ 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, 100);
ft_draw_map(data);
mlx_hook(data->window, 17, (0L), ft_exit, data);

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 16:20:03 by cchauvet #+# #+# */
/* Updated: 2023/01/13 15:50:03 by cchauvet ### ########.fr */
/* Updated: 2023/01/13 18:37:03 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */