feat: Added the round counter on the hud

This commit is contained in:
Theo Champion 2025-09-03 18:39:30 +02:00
parent 82d7941e81
commit f80eb125f5
24 changed files with 1217 additions and 115 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
/* Updated: 2025/09/03 16:32:13 by tchampio ### ########.fr */
/* Updated: 2025/09/03 18:31:54 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -74,12 +74,33 @@ void draw_perks(t_cub3d_data *data)
}
}
void draw_round(t_cub3d_data *data)
{
int i;
int pos;
char round_str[5];
if (data->round <= 5)
return (matrix_image_put(data, data->tally_marks[data->round - 1], 20, HEIGHT - 85));
pos = 20;
i = 0;
ft_itoa_static(data->round, round_str, 5);
while (round_str[i])
{
matrix_image_put(data, data->round_figures[round_str[i] - '0'], pos, HEIGHT - 85);
pos += 50;
i++;
}
}
void create_hud(t_cub3d_data *data)
{
// draw points
draw_points(data);
// draw perks
draw_perks(data);
// draw round
draw_round(data);
// draw weapon
// draw map
}