def __init__(self, name, x, y): pygame.sprite.Sprite.__init__(self) self.object = map.load_image(name+".png", -1) self.pos_x = x self.pos_y = y self.area = map.load_image("area_"+name+".png", -1) self.s_x, self.s_y = shadow(name, self.pos_x, self.pos_y) self.rect = Rect((self.s_x, self.s_y, self.area.get_width(), self.area.get_height())) self.type = "mapobject"
def __init__(self, weapon): pygame.sprite.Sprite.__init__(self) self.stand_image = map.load_image(weapon+"_right.png") self.stand_image_left = map.load_image(weapon+"_left.png") self.weapon = weapon att_image = map.load_image(weapon+"_att_right.png") self.right_att = hero.get_frame(hero.get_image_list(att_image, 50)) att_image = map.load_image(weapon+"_att_left.png") self.left_att = hero.get_frame(hero.get_image_list(att_image, 50)) self.att_area_image = map.load_image(weapon+"_att_area.png", -1) self.rect = self.att_area_image.get_rect() self.speed = speed(weapon) self.damage = damage(weapon) self.pos_x, self.pos_y = (0, 0) self.image_view = self.stand_image self.f_delay = 0 self.attack = False self.f_attack = 0