diff --git a/asset.o b/asset.o index 53f5fef..1a7c262 100644 Binary files a/asset.o and b/asset.o differ diff --git a/draw.c b/draw.c index 736ac51..1c5f118 100644 --- a/draw.c +++ b/draw.c @@ -6,7 +6,7 @@ /* By: cchauvet assets[data->nb_swaps + 3 % NB_COLORS]); if (c == 'P') return (data->assets[data->nb_swaps + 4 % NB_COLORS]); - if (c == 'B') + if (c == 'B' && BONUS) return (data->assets[data->nb_swaps + 5 % NB_COLORS]); return (NULL); } @@ -59,7 +59,7 @@ int ft_draw_map(t_data *data) ft_fill_pos(data->map); if (BONUS) - data->nb_swaps++; + data->nb_swaps = ++data->nb_swaps % NB_COLORS; patern = ft_get_player_map(*data->map); if (patern == NULL) return (1); diff --git a/draw.o b/draw.o index cd01475..5b641dc 100644 Binary files a/draw.o and b/draw.o differ diff --git a/key.o b/key.o index aa87e42..b365818 100644 Binary files a/key.o and b/key.o differ diff --git a/main.c b/main.c index 6c18c3d..7813c76 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: cchauvet nb_foots = 0; data->nb_swaps = 35; if (BONUS) - data->nb_swaps = ft_random_generator(0, 100); + data->nb_swaps = ft_random_generator(0, NB_COLORS); ft_draw_map(data); mlx_hook(data->window, 17, (0L), ft_exit, data); mlx_hook(data->window, 2, (1L << 0), ft_key, data); diff --git a/main.o b/main.o index ebaa6c8..575c9b7 100644 Binary files a/main.o and b/main.o differ diff --git a/parsing.o b/parsing.o index 52efe9f..9de02a2 100644 Binary files a/parsing.o and b/parsing.o differ diff --git a/parsing2.o b/parsing2.o index bae5763..c585089 100644 Binary files a/parsing2.o and b/parsing2.o differ diff --git a/so_long b/so_long index 3c51962..8a7c3f7 100755 Binary files a/so_long and b/so_long differ diff --git a/solong.h b/solong.h index 691908d..7cc9f51 100644 --- a/solong.h +++ b/solong.h @@ -6,7 +6,7 @@ /* By: cchauvet 0) - (Value < 0))) -# define BONUS 0 +# define BONUS 1 typedef struct s_square {