feat: Added shooting event

This commit is contained in:
Theo Champion 2025-09-14 17:42:48 +02:00
parent b0ac26a7f6
commit d7781f44d2
2 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
/* Updated: 2025/09/10 15:34:15 by tchampio ### ########.fr */
/* Updated: 2025/09/14 16:41:00 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -36,11 +36,10 @@
void handle_shooting(t_cub3d_data *data)
{
if (!data->keypresses.is_space_pressed)
return ;
else
if (data->keypresses.is_space_pressed)
{
if (!data->player.weapon.is_auto)
data->keypresses.is_space_pressed = false;
}
}
@ -53,6 +52,7 @@ int game_loop(t_cub3d_data *data)
data->last_tick = get_milliseconds();
reset_matrix(data);
move_player(data);
handle_shooting(data);
move_sprites(data);
raycaster(data, &ray);
sprite_caster(data);

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:22:57 by kcolin #+# #+# */
/* Updated: 2025/09/10 15:33:38 by tchampio ### ########.fr */
/* Updated: 2025/09/14 15:57:54 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */