Ejemplo n.º 1
0
    def draw(self):
        self.screen.fill(Color.DARK_GRAY)

        text_line = GetFont(32).render("Debugging Options", 1,
                                       Color.MOSTLY_WHITE)
        text_line_rect = text_line.get_rect(centerx=game_constants.w / 2,
                                            top=20)

        options_texts = []
        for i, option_str in enumerate(self.options_order):
            color = Color.MOSTLY_WHITE
            if (i == self.selected_option):
                color = Color.YELLOW
            options_texts.append(
                GetFont(24).render(option_str.upper(), 1, color))

        draw_h = game_constants.h / 2
        for option in options_texts:
            rect = option.get_rect(centerx=game_constants.w / 2, top=draw_h)
            self.screen.blit(option, rect)
            draw_h += rect.height

        self.screen.blit(text_line, text_line_rect)

        pygame.display.update()
        self.dirty = False
Ejemplo n.º 2
0
    def draw(self):
        self.screen.fill(Color.DARK_GRAY)

        text_line = GetFont(32).render("INTENSE OPTIONS SCREEN", 1, Color.MOSTLY_WHITE)
        text_line_rect = text_line.get_rect(centerx = game_constants.w / 2, top = 20)

        self.screen.blit(text_line, text_line_rect)

        [group.draw() for group in self.option_groups]

        text_line = GetFont(16).render("(Space to select, return to continue)", 1, Color.MOSTLY_WHITE)
        text_line_rect = text_line.get_rect(centerx = game_constants.w / 2, bottom = game_constants.h - 20)
        self.screen.blit(text_line, text_line_rect)

        pygame.display.update()
        self.dirty = False
Ejemplo n.º 3
0
    def draw(self):
        self.screen.fill(Color.BLACK)
        message = GetFont(72).render("GAME OVER", 1, Color.MOSTLY_WHITE)
        instr = GetFont(32).render("Return to restart, Esc to quit.", 1,
                                   Color.MOSTLY_WHITE)
        self.screen.blit(
            message,
            message.get_rect(centerx=self.screen.get_width() / 2,
                             centery=self.screen.get_height() * .25))
        self.screen.blit(
            instr,
            instr.get_rect(centerx=self.screen.get_width() / 2,
                           centery=self.screen.get_height() * .75))
        pygame.display.update()

        self.dirty = False
Ejemplo n.º 4
0
    def draw(self):
        self.screen.fill(Color.DARK_GRAY)

        enemies = [
            (self.soldier, "SOLDIERS are constrained by the laws of gravity."),
            (self.chopper, "COPTERS can fly, but won't go through platforms."),
            (self.ghost, "GHOSTS can float anywhere they like."),
        ]

        instructions_text = """Type the words that appear over enemies to defeat them.
Type the character that appears on a platform to jump to it.
Press CTRL to deselect a word.
Press space to turn around.
Press return to continue."""

        last_y = game_constants.h
        for text in reversed(instructions_text.split("\n")):
            rendered_text = GetFont(16).render(text, 1, Color.MOSTLY_WHITE)

            cur_y = last_y - rendered_text.get_height()
            self.screen.blit(
                rendered_text,
                rendered_text.get_rect(centerx=game_constants.w / 2,
                                       centery=cur_y))
            last_y = cur_y

        for image, text in reversed(enemies):
            rendered_text = GetFont(16).render(text, 1, Color.MOSTLY_WHITE)

            cur_y = last_y - rendered_text.get_height() - 20
            rect = rendered_text.get_rect(centerx=game_constants.w / 2,
                                          centery=cur_y)
            self.screen.blit(rendered_text, rect)
            self.screen.blit(
                image,
                image.get_rect(centerx=rect.left - image.get_width() - 10,
                               centery=cur_y))
            last_y = cur_y

        gunstar_top = last_y / 2 - self.image.get_height() / 2
        self.screen.blit(
            self.image,
            self.image.get_rect(centerx=game_constants.w / 2, top=gunstar_top))

        pygame.display.update()
        self.dirty = False
Ejemplo n.º 5
0
    def draw(self):
        self.screen.fill(Color.BLACK)
        message = GetFont(72).render("GAME OVER", 1, Color.MOSTLY_WHITE)
        instr = GetFont(32).render("Return to restart, Esc to quit.", 1, Color.MOSTLY_WHITE)
        self.screen.blit(
            message,
            message.get_rect(
                centerx = self.screen.get_width() / 2,
                centery = self.screen.get_height() * .25))
        self.screen.blit(
            instr,
            instr.get_rect(
                centerx = self.screen.get_width() / 2,
                centery = self.screen.get_height() * .75))
        pygame.display.update()

        self.dirty = False
Ejemplo n.º 6
0
    def draw(self):
        self.screen.fill((0, 0, 0))
        message = GetFont(72).render("Loading...", 1, Color.MOSTLY_WHITE)
        self.screen.blit(
            message,
            message.get_rect(centerx=self.screen.get_width() / 2,
                             centery=self.screen.get_height() * .25))
        pygame.display.update()

        self.dirty = False
Ejemplo n.º 7
0
    def draw(self):
        self.screen.fill(Color.DARK_GRAY)

        enemies = [
            (self.soldier, "SOLDIERS are constrained by the laws of gravity."),
            (self.chopper, "COPTERS can fly, but won't go through platforms."),
            (self.ghost,   "GHOSTS can float anywhere they like."),
        ]

        instructions_text = """Type the words that appear over enemies to defeat them.
Type the character that appears on a platform to jump to it.
Press CTRL to deselect a word.
Press space to turn around.
Press return to continue."""

        last_y = game_constants.h
        for text in reversed(instructions_text.split("\n")):
            rendered_text = GetFont(16).render(text, 1, Color.MOSTLY_WHITE)

            cur_y = last_y - rendered_text.get_height()
            self.screen.blit(
                rendered_text,
                rendered_text.get_rect(centerx = game_constants.w / 2, centery = cur_y))
            last_y = cur_y

        for image, text in reversed(enemies):
            rendered_text = GetFont(16).render(text, 1, Color.MOSTLY_WHITE)

            cur_y = last_y - rendered_text.get_height() - 20
            rect = rendered_text.get_rect(centerx = game_constants.w / 2, centery = cur_y)
            self.screen.blit(rendered_text, rect)
            self.screen.blit(
                image,
                image.get_rect(centerx = rect.left - image.get_width() - 10, centery = cur_y))
            last_y = cur_y

        gunstar_top = last_y / 2 - self.image.get_height() / 2
        self.screen.blit(
            self.image,
            self.image.get_rect(centerx = game_constants.w / 2, top = gunstar_top))

        pygame.display.update()
        self.dirty = False
Ejemplo n.º 8
0
    def draw(self):
        self.screen.fill(Color.DARK_GRAY)

        text_line = GetFont(32).render("INTENSE OPTIONS SCREEN", 1,
                                       Color.MOSTLY_WHITE)
        text_line_rect = text_line.get_rect(centerx=game_constants.w / 2,
                                            top=20)

        self.screen.blit(text_line, text_line_rect)

        [group.draw() for group in self.option_groups]

        text_line = GetFont(16).render("(Space to select, return to continue)",
                                       1, Color.MOSTLY_WHITE)
        text_line_rect = text_line.get_rect(centerx=game_constants.w / 2,
                                            bottom=game_constants.h - 20)
        self.screen.blit(text_line, text_line_rect)

        pygame.display.update()
        self.dirty = False
Ejemplo n.º 9
0
    def draw(self):
        self.screen.fill((0, 0, 0))
        message = GetFont(72).render("Loading...", 1, Color.MOSTLY_WHITE)
        self.screen.blit(
            message,
            message.get_rect(
                centerx = self.screen.get_width() / 2,
                centery = self.screen.get_height() * .25))
        pygame.display.update()

        self.dirty = False
Ejemplo n.º 10
0
    def draw(self):
        self.screen.fill(Color.DARK_GRAY)
        title = GetFont(50).render("TYPER COMBAT", 1, Color.MOSTLY_WHITE)
        title_rect = title.get_rect(centerx = game_constants.w / 2, top = 0)
        self.screen.blit(title, title_rect)

        options_texts = []
        for i, option_str in enumerate(self.options_order):
            color = Color.MOSTLY_WHITE
            if (i == self.selected_option):
                color = Color.YELLOW
            options_texts.append(GetFont(24).render(option_str.upper(), 1, color))

        draw_h = game_constants.h / 2
        for option in options_texts:
            rect = option.get_rect(centerx = game_constants.w / 2, top = draw_h)
            self.screen.blit(option, rect)
            draw_h += rect.height

        pygame.display.update()
        self.dirty = False