From 678d6f620aa95baede2b2ff7895f61206b45345c Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Fri, 23 Sep 2022 22:22:51 +0200 Subject: [PATCH] Fixed bug with path drawing --- columbus/env.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/columbus/env.py b/columbus/env.py index 3a659e7..b87863e 100644 --- a/columbus/env.py +++ b/columbus/env.py @@ -277,8 +277,13 @@ class ColumbusEnv(gym.Env): self.setup() self.entities.append(self.agent) # add it last, will be drawn on top self.observable.reset() + self._reset_paths() return self.observable.get_observation() + def _reset_paths(self): + self.path_overlay = pygame.Surface( + (self.width, self.height), pygame.SRCALPHA, 32) + def _draw_entities(self): for entity in self.entities: entity.draw()