Exemplo n.º 1
0
    def _draw_ellipse(self, colour, rect_offset, border):
        rect = add_lists(self.rect[:2], rect_offset[:2]) + rect_offset[2:]

        pygame.draw.ellipse(
                self.screen,
                get_colour(colour),
                rect,
                border
                )
Exemplo n.º 2
0
Arquivo: game.py Projeto: nicr9/djinn
    def __init__(self, window_size, window_caption, bg, refresh_rate, res_path):
        # Attributes
        self.window_size = window_size
        self.window_caption = window_caption
        self.bg = get_colour(bg)
        self.refresh_rate = refresh_rate
        self.counter = 0

        # Setup sprite stuff
        self.player = None
        self._groups = defaultdict(DjinnGroup)

        # Init
        pygame.init()
        self.screen = pygame.display.set_mode(self.window_size)
        pygame.display.set_caption(self.window_caption)
        self.clock = pygame.time.Clock()
        self.res_store = Resources(self.screen, res_path)
Exemplo n.º 3
0
 def _draw_text(self, text, colour, coords):
     font = pygame.font.SysFont("monospace", 15)
     label = font.render(text, 1, get_colour(colour))
     self.screen.blit(label, coords)