Skip to content

Commit

Permalink
Norm ok + enemy folows player
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkosComK committed Jan 26, 2025
1 parent fb9c3fb commit 32c7289
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions srcs/engine/enemy/enemy_dist.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: marsoare <marsoare@student.42porto.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/26 16:14:58 by marsoare #+# #+# */
/* Updated: 2025/01/26 16:17:49 by marsoare ### ########.fr */
/* Updated: 2025/01/26 16:19:45 by marsoare ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -54,7 +54,8 @@ void update_enemies(t_game *game)
if (current->enemy.alive)
{
calculate_enemy_distance(game, &current->enemy);
if (current->enemy.dist_to_player <= current->enemy.detection_radius)
if (current->enemy.dist_to_player
<= current->enemy.detection_radius)
update_enemy_position(&current->enemy, game, speed);
}
current = current->next;
Expand Down

0 comments on commit 32c7289

Please # to comment.