Пример #1
0
class Enemy(Entity):
    def __init__(self, enemy_rect, sign=None, w=1.0):
        Entity.__init__(self, enemy_rect, sign, w)
        self.bar = Enemy_Bar(self.stats, (self.centerx, self.centery))
    
    def move(self):
        print self.base_speed
        self.x -= self.base_speed
    
    def drop(self, pickup_sign):
        return Rupee(self.right, self.bottom, sign=pickup_sign)

    def update_bar(self):
        self.bar.update(self.stats, (self.centerx, self.centery), (self.width, self.height))

    def get_hit_by(self, projectile):
        super(Enemy, self).get_hit_by(projectile)
        self.bar.set_visible()
Пример #2
0
 def __init__(self, enemy_rect, sign=None, w=1.0):
     Entity.__init__(self, enemy_rect, sign, w)
     self.bar = Enemy_Bar(self.stats, (self.centerx, self.centery))