about summary refs log tree commit diff homepage
path: root/brutalmaze/characters.py
diff options
context:
space:
mode:
Diffstat (limited to 'brutalmaze/characters.py')
-rw-r--r--brutalmaze/characters.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/brutalmaze/characters.py b/brutalmaze/characters.py
index 6daaf70..e123dec 100644
--- a/brutalmaze/characters.py
+++ b/brutalmaze/characters.py
@@ -186,14 +186,12 @@ class Enemy:
         if self.offsety:
             self.offsety -= sign(self.offsety)
             return True
-        if (self.next_strike > pygame.time.get_ticks()
-            or (self.x, self.y) in AROUND_HERO):
-            return False
+        if self.next_strike > pygame.time.get_ticks(): return False
 
         self.move_speed = self.maze.fps / speed
         directions = [(sign(MIDDLE - self.x), 0), (0, sign(MIDDLE - self.y))]
         shuffle(directions)
-        directions.append(choice(CROSS))
+        directions.append(choice((choice(ADJACENT_GRIDS), (0, 0))))
         for x, y in directions:
             if (x or y) and self.maze.map[self.x + x][self.y + y] == EMPTY:
                 self.offsetx = round(x * (1 - self.move_speed))