so_long/games/enemy.c
Etienne Rey-bethbeder 5e57f44071 Avancement
2023-01-01 19:50:24 +01:00

25 lines
660 B
C

int path_finding(char **map_cpy, t_xy cur, t_xy ply, int nbr)
{
if (cur.x == ply.x && cur.y == ply.y)
return (nbr);
map_cpy[x][y] = 'x';
if (map_cpy[x][y + 1] != '1' && map_cpy[x][y + 1] != 'x')
if (is_possible(map, map_cpy, x, y + 1, nbr++))
if (map_cpy[x + 1][y] != '1' && map_cpy[x + 1][y] != 'x')
if (is_possible(map, map_cpy, x + 1, y, nbr))
if (map_cpy[x - 1][y] != '1' && map_cpy[x - 1][y] != 'x')
if (is_possible(map, map_cpy, x - 1, y, nbr))
*check =
if (map_cpy[x][y - 1] != '1' && map_cpy[x][y - 1] != 'x')
if (is_possible(map, map_cpy, x, y - 1, nbr))
*check = 1;
return (0);
}
void move_enemy(t_data *data)
{
}