Exemple #1
0
 def get_macro(self):
     macro = Macro(len(self.tile_containers))
     for i, container in enumerate(self.tile_containers):
         if container.tiles:
             macro.add_block(container.tiles[0], i)
         else:
             macro.add_block(False, i)
     return macro
Exemple #2
0
    def __init__(self):
        pygame.init()
        self.screen_blit = pygame.display.set_mode(BLIT_SIZE)
        self.screen = pygame.Surface(WINDOW_SIZE)
        self.editor = Editor()
        self.sel = CharacterSelect(self.screen_blit).sel
        self.player = Player(self, 0, 0, idx=self.sel)
        self.camera = Camera()
        self.level = 0

        self.black_screen = pygame.Surface(WINDOW_SIZE).convert()
        self.black_screen.fill((0, 0, 0))
        self.black_alpha = 255.0
        self.black_screen.set_alpha(self.black_alpha)
        self.black_shade = DOWN

        self.load_level()
        self.delay = 0
        self.command_font = pygame.font.SysFont("monospace", 12)
        self.command_rectangles = {}
        test_macro = Macro()
        test_macro.add_block(Right())
        test_macro.add_block(AttackRight())
        test_macro.add_block(Left())
        self.player.macros[0] = test_macro

        self.heart = pygame.image.load("heart.png")
        self.hheart = pygame.image.load("half_heart.png")
        self.eheart = pygame.image.load("empty_heart.png")
        self.heart_width = self.heart.get_width()

        self.mana_bar = pygame.image.load("mana_outer_bar.png")
        self.mana_fill = pygame.image.load("mana_inner_bar.png")
        self.display_mana = self.player.mana