示例#1
0
    def load_sprites(self):
        helper = Sprites()
        portrait_path = helper.get_sprite(self._res_name, 'portrait')
        portrait_image = pg.image.load(portrait_path)
        self.portrait = (portrait_image, portrait_image.get_rect())

        battle_path = helper.get_sprite(self._res_name, 'battle_idle')
        self.battle_image = pg.transform.scale(pg.image.load(battle_path),
                                               (30, 38))
        bg_color = "#7bd5fe"
        self.battle_image.set_colorkey(pg.Color(bg_color))
        self.battle_rect = self.battle_image.get_rect()
示例#2
0
    def load_map_sprite(self):
        helper = SpritesHelper()
        image = pg.transform.scale(
            pg.image.load(helper.get_sprite('dark_elem', 'map')), (24, 36))
        image.set_colorkey(pg.Color("#fec5c5"))

        return image
示例#3
0
 def load_sprites(self):
     helper = SpritesHelper()
     self.image = pg.transform.scale(
         pg.image.load(helper.get_sprite('dark_elem', 'battle_idle')),
         (24, 36))
     self.image.set_colorkey(pg.Color("#fec5c5"))
     self.rect = self.image.get_rect()
示例#4
0
    def load_map_sprite(self):
        helper = SpritesHelper()
        image = pg.transform.scale(
            pg.image.load(helper.get_sprite('test', 'map')), (30, 38))
        image.set_colorkey(pg.Color("#7bd5fe"))

        return image
示例#5
0
 def load_sprite(self):
     helper = SpritesHelper()
     self.image = pg.transform.scale(
         pg.image.load(helper.get_sprite('wizard', 'map')), (30, 38))
     self.image.set_colorkey(pg.Color("#7bd5fe"))
     self.rect = self.image.get_rect()
     self.rect.x = self.x
     self.rect.y = self.y
示例#6
0
 def __init__(self, persistent=None):
     super().__init__()
     self.font = pg.font.Font(None, 24)
     helper = SpritesHelper()
     splash_path = helper.get_sprite('splash', 'endgame')
     self.splash = pg.image.load(splash_path)
     self.splash_rect = self.splash.get_rect(center=self.screen_rect.center)
     self.bg = pg.Surface((self.screen_width, self.screen_height))
     self.bg.fill(pg.Color('black'))
示例#7
0
 def animate_spell(self, target):
     """
     Called to create moving spell sprite
     """
     helper = SpritesHelper()
     image = pg.image.load(helper.get_sprite(self.last_action_func.name, "projectile"))
     image.set_colorkey(pg.Color("#7bd5fe"))
     rect = image.get_rect()
     rect.x = self.current_character.battle_rect.x
     rect.y = self.current_character.battle_rect.y
     target_rect = target.rect
     self.spell_anim = {'image': image,'rect': rect, 'target_rect': target_rect}
示例#8
0
 def load_sprites(self):
     helper = SpritesHelper()
     self.image = pg.transform.scale(
         pg.image.load(helper.get_sprite('test', 'battle_idle')), (30, 38))
     self.image.set_colorkey(pg.Color("#7bd5fe"))
     self.rect = self.image.get_rect()