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()
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
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()
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
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
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'))
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}
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()