def __init__(self, size, x=0, y=0, w=0, h=0, color=None): super(Monster, self).__init__() self.speed = 150 self.size = size self.color = color if color is not None else Color.Rand() self.rect = pygame.Rect(x, y, w, h) self.xdir = 0 # 1 for left, 0 for right self.down = 0 # 0 for not y 1 for going y self.went = 0 # when reaches h, switch xdir