Fixed Bug with path_overlay

This commit is contained in:
Dominik Moritz Roth 2022-09-23 23:11:03 +02:00
parent 678d6f620a
commit d4a1a35190

View File

@ -62,10 +62,10 @@ class Entity(object):
self._draw_path() self._draw_path()
def _draw_path(self): def _draw_path(self):
self.last_pos = self.pos[0], self.pos[1]
if self.draw_path and self.last_pos: if self.draw_path and self.last_pos:
pygame.draw.line(self.env.path_overlay, self.draw_path_col, pygame.draw.line(self.env.path_overlay, self.draw_path_col,
(self.last_pos[0]*self.env.width, self.last_pos[1]*self.env.height), (self.pos[0]*self.env.width, self.pos[1]*self.env.height), self.draw_path_width) (self.last_pos[0]*self.env.width, self.last_pos[1]*self.env.height), (self.pos[0]*self.env.width, self.pos[1]*self.env.height), self.draw_path_width)
self.last_pos = self.pos[0], self.pos[1]
def on_collision(self, other, depth): def on_collision(self, other, depth):
if self.solid and other.solid: if self.solid and other.solid: