- class arcade.AStarBarrierList(moving_sprite: arcade.sprite.Sprite, blocking_sprites: arcade.sprite_list.sprite_list.SpriteList, grid_size: int, left: int, right: int, bottom: int, top: int)#
Class that manages a list of barriers that can be encountered during A* path finding.
moving_sprite (Sprite) – Sprite that will be moving
blocking_sprites (SpriteList) – Sprites that can block movement
grid_size (int) – Size of the grid, in pixels
left (int) – Left border of playing field
right (int) – Right border of playing field
bottom (int) – Bottom of playing field
top (int) – Top of playing field
Recalculate blocking sprites.
- arcade.astar_calculate_path(start_point: Union[Tuple[float, float], List[float]], end_point: Union[Tuple[float, float], List[float]], astar_barrier_list: arcade.paths.AStarBarrierList, diagonal_movement=True)#
- arcade.has_line_of_sight(point_1: Union[Tuple[float, float], List[float]], point_2: Union[Tuple[float, float], List[float]], walls: arcade.sprite_list.sprite_list.SpriteList, max_distance: int = - 1, check_resolution: int = 2)#
Determine if we have line of sight between two points. Try to make sure that spatial hashing is enabled on the wall SpriteList or this will be very slow.