kekw
This commit is contained in:
parent
6312ed4cdc
commit
1331231004
6
draw.c
6
draw.c
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
|
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/01/13 18:34:28 by cchauvet ### ########.fr */
|
/* Updated: 2023/01/13 18:58:18 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]);
|
return (data->assets[data->nb_swaps + 3 % NB_COLORS]);
|
||||||
if (c == 'P')
|
if (c == 'P')
|
||||||
return (data->assets[data->nb_swaps + 4 % NB_COLORS]);
|
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 (data->assets[data->nb_swaps + 5 % NB_COLORS]);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ int ft_draw_map(t_data *data)
|
|||||||
|
|
||||||
ft_fill_pos(data->map);
|
ft_fill_pos(data->map);
|
||||||
if (BONUS)
|
if (BONUS)
|
||||||
data->nb_swaps++;
|
data->nb_swaps = ++data->nb_swaps % NB_COLORS;
|
||||||
patern = ft_get_player_map(*data->map);
|
patern = ft_get_player_map(*data->map);
|
||||||
if (patern == NULL)
|
if (patern == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
|
4
main.c
4
main.c
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/12/12 17:20:17 by cchauvet #+# #+# */
|
/* Created: 2022/12/12 17:20:17 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/01/13 18:35:20 by cchauvet ### ########.fr */
|
/* Updated: 2023/01/13 18:50:00 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ int ft_initialised(char *path, t_data *data)
|
|||||||
data->nb_foots = 0;
|
data->nb_foots = 0;
|
||||||
data->nb_swaps = 35;
|
data->nb_swaps = 35;
|
||||||
if (BONUS)
|
if (BONUS)
|
||||||
data->nb_swaps = ft_random_generator(0, 100);
|
data->nb_swaps = ft_random_generator(0, NB_COLORS);
|
||||||
ft_draw_map(data);
|
ft_draw_map(data);
|
||||||
mlx_hook(data->window, 17, (0L), ft_exit, data);
|
mlx_hook(data->window, 17, (0L), ft_exit, data);
|
||||||
mlx_hook(data->window, 2, (1L << 0), ft_key, data);
|
mlx_hook(data->window, 2, (1L << 0), ft_key, data);
|
||||||
|
BIN
parsing2.o
BIN
parsing2.o
Binary file not shown.
6
solong.h
6
solong.h
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/01/04 16:20:03 by cchauvet #+# #+# */
|
/* Created: 2023/01/04 16:20:03 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/01/13 18:37:03 by cchauvet ### ########.fr */
|
/* Updated: 2023/01/13 18:56:12 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -20,11 +20,11 @@
|
|||||||
# define CASE_SIZE 64
|
# define CASE_SIZE 64
|
||||||
# define XPM_HEADER "\nstatic char * XFACE[] = {\""
|
# define XPM_HEADER "\nstatic char * XFACE[] = {\""
|
||||||
# define COLORS "silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"
|
# define COLORS "silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"
|
||||||
# define NB_COLORS 99
|
# define NB_COLORS 93
|
||||||
# define RENDER_DISTANCE 5
|
# define RENDER_DISTANCE 5
|
||||||
# define WINDOW_SIZE (RENDER_DISTANCE * 2 + 1) * CASE_SIZE
|
# define WINDOW_SIZE (RENDER_DISTANCE * 2 + 1) * CASE_SIZE
|
||||||
# define ABS(Value) (Value * ((Value > 0) - (Value < 0)))
|
# define ABS(Value) (Value * ((Value > 0) - (Value < 0)))
|
||||||
# define BONUS 0
|
# define BONUS 1
|
||||||
|
|
||||||
typedef struct s_square
|
typedef struct s_square
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user