From c4d7765967fb7434e096b72cf0139c241c2c49fd Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Sat, 6 Nov 2021 14:37:08 -0400 Subject: [PATCH] Correct "limited vision" ai when interacting with walls --- src/systems.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/systems.py b/src/systems.py index 99dd9c9..2177927 100644 --- a/src/systems.py +++ b/src/systems.py @@ -515,7 +515,6 @@ class AISystem(sdl2.ext.Applicator, AbstractMovementSystem): y_index = 0 while x_index + y_index <= vision_radius: - # Handle for (+x/+y) tiles. tile_x = roomba_x + x_index tile_y = roomba_y + y_index @@ -611,7 +610,8 @@ class AISystem(sdl2.ext.Applicator, AbstractMovementSystem): # Check if trash exists at location. if next_tile.trashpile.exists: # Trash exists. Attempt to move to location. - self.move_full_sight(sprite, path_set=['{0}, {1}'.format(roomba_x, roomba_y), tile_id]) + path_set = self.data_manager.ideal_trash_paths['roomba'][tile_id] + self.move_full_sight(sprite, path_set=path_set) has_moved = True break -- GitLab