mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 09:58:09 +01:00
Started bonus part
- added bonus rules in makefile - added a BONUS define for bonus - added a conditional check for characters
This commit is contained in:
parent
34db19c1a2
commit
5c1d469cac
7 changed files with 93 additions and 27 deletions
12
src/main.c
12
src/main.c
|
|
@ -6,7 +6,7 @@
|
|||
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/06 13:16:11 by tchampio #+# #+# */
|
||||
/* Updated: 2025/06/30 16:12:19 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/07/02 15:32:23 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -80,6 +80,14 @@ void draw_map(t_mapdata *map, t_mlx_data *data)
|
|||
{
|
||||
if (map->map[i][j] == '1')
|
||||
draw_2d_wall(map->f_color, data, 20, 20 * j, 20 * i);
|
||||
else if (map->map[i][j] == 'Z' || map->map[i][j] == 'z')
|
||||
draw_2d_wall(0x0008D9D6, data, 20, 20 * j, 20 * i);
|
||||
else if (map->map[i][j] == 'D' || map->map[i][j] == 'd')
|
||||
draw_2d_wall(0x00FF2E63, data, 20, 20 * j, 20 * i);
|
||||
else if (map->map[i][j] == 's')
|
||||
draw_2d_wall(0x00E84545, data, 20, 20 * j, 20 * i);
|
||||
else if (map->map[i][j] == 'M')
|
||||
draw_2d_wall(0x00F4CE14, data, 20, 20 * j, 20 * i);
|
||||
else if (ft_strchr("NSEW", map->map[i][j]))
|
||||
draw_2d_wall(0x00FF0000, data, 20, 20 * j, 20 * i);
|
||||
j++;
|
||||
|
|
@ -107,7 +115,7 @@ int main(int argc, char **argv)
|
|||
mlx_key_hook(data.mlx_win, key_destroy, &data);
|
||||
mlx_put_image_to_window(data.mlx, data.mlx_win, data.mlx_data->img, 0, 0);
|
||||
#ifdef BONUS
|
||||
mlx_string_put(data.mlx, data.mlx_win, 100, 100, 0x00FFFFFF, "compiled with bonuses");
|
||||
mlx_string_put(data.mlx, data.mlx_win, 10, 10, 0x00FFFFFF, "compiled with bonuses");
|
||||
#endif
|
||||
mlx_loop(data.mlx);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue