예제 #1
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()
예제 #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_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
예제 #4
0
    def load_sprites(self):
        """
        Loads sprites of player and npc characters and places them on screen, appends to sprites list
        """
        helper = SpritesHelper()
        image = pg.image.load(helper.get_bg(self.persist['bg']))
        rect = image.get_rect()
        rect.height = self.screen_height
        rect.width = self.screen_width
        image = pg.transform.scale(image, (self.screen_width, self.screen_height))
        self.bg = (image, rect)

        x = self.screen_width * 0.1
        y = self.screen_height * 0.3

        for i in self.npc_party:
            i.rect.x = x
            i.rect.y = y
            self.sprites.append((i.image, i.rect))
            y += i.rect.height + 10

        y = self.screen_height * 0.3
        x = self.screen_width * 0.8
        for i in self.player_party:
            i.battle_rect.x = x
            i.battle_rect.y = y
            self.sprites.append((i.battle_image, i.battle_rect))
            y += i.battle_rect.height + 10
예제 #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()