예제 #1
0
 def draw(self, screen):
     for name, button in self.buttons.items():
         pygame.draw.rect(screen, self.bg_color, button)
         pygame.draw.rect(screen, self.border_color, button, 3)
         text.write(screen,
                    name,
                    button.center,
                    font_cat='std_black',
                    centered=True)
예제 #2
0
 def draw(self, screen):
     pygame.draw.rect(screen, BLUE, self.rect)
     text.write(screen,
                self.page_name,
                self.rect.center,
                font_cat='std',
                centered=True)
     for item in self.items:
         item.draw(screen)
예제 #3
0
    def draw(self, screen):
        pygame.draw.rect(screen, DARK_GREEN, self.rect)
        pygame.draw.rect(screen, BLACK, self.rect, 2)

        text.write(screen,
                   self.name, (self.rect.centerx, self.rect.top + 20),
                   font_cat='hdr',
                   centered=True)
        text.write(screen,
                   'lvl: {}'.format(self.game_data.upgrades[self.name]['lvl']),
                   (self.rect.centerx, self.rect.top + 80),
                   font_cat='std',
                   centered=True)
        text.write(screen,
                   'cost: {}'.format(
                       self.game_data.upgrades[self.name]['cost']),
                   (self.rect.centerx, self.rect.top + 120),
                   font_cat='std',
                   centered=True)
        text.write(screen,
                   'improvement: {} -> {}'.format(
                       self.game_data.upgrades[self.name]['lvl'] *
                       self.game_data.upgrades[self.name]['improv'],
                       (self.game_data.upgrades[self.name]['lvl'] + 1) *
                       self.game_data.upgrades[self.name]['improv']),
                   (self.rect.centerx, self.rect.top + 160),
                   font_cat='std',
                   centered=True)
예제 #4
0
    def draw(self, screen):
        screen.fill(BLACK)
        self.village.draw(screen)
        self.mine.draw(screen)
        self.upgrade_menu.draw(screen)
        # text.write(screen, 'time: {}'.format(self.wave_manager.time_lapsed), (20,20))
        text.write(screen, 'wave: {}'.format(self.wave_manager.wave_number),
                   (20, 20))
        text.write(screen, 'day: {}'.format(self.wave_manager.day), (20, 40))
        text.write(screen,
                   'gold: {}'.format(self.game_data.gold), (SW - 20, 20),
                   right=True)

        for enemy in self.enemies:
            enemy.draw(screen)
예제 #5
0
 def draw(self, surf):
     pygame.draw.rect(self.image, self.bg_color, ((0,0), self.size))
     pygame.draw.rect(self.image, self.line_color, ((0,0), self.size), 3)
     text.write(self.image, self.text, (self.rect.width/2, (self.rect.height/2) -2) ,color = self.text_color, centered = True)
     surf.blit(self.image, self.pos)
예제 #6
0
 def draw(self, screen):
     text.write(screen,
                '{}'.format(self.hp), (self.pos[0], self.pos[1] - 20),
                centered=True)
     pygame.draw.circle(screen, RED, self.rect.center, self.radius)