def __init__(self, E_x, E_y, E_speed, e_direct):
self.x = E_x
self.y = E_y
self.speed = E_speed
self.directt = e_direct
self.anim_count = 0
if self.direct == 'l':
_window.blit(self.enemyLeft [self.anim_count // 5], (self.x, self.y))
self.anim_count = self.anim_count +1
elif self.direct == 'b':
_window.blit(self.enemyRight [self.anim_count // 5], (self.x, self.y))
self.anim_count = self.anim_count + 1
elif self.direct == 't':
_window.blit(self.enemyTop [self.anim_count // 5], (self.x, self.y))
self.anim_count = self.anim_count + 1
elif self.direct == 't':
_window.blit(self.enemyBottom [self.anim_count // 5], (self.x, self.y))
self.anim_count = self.anim_count + 1
В последнем условном выражении elif self.direct == 't': происходит попытка сравнить атрибут self.direct с самим собой, что приводит к бесконечному циклу.
Исправьте выражение следующим образом:
elif self.direct == 'r':
где 'r' - это правильное направление.