def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image"""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "THE BODY COSMIC",
            fg=color.menu_title,
            bg=color.black,
            alignment=tcod.CENTER,
            bg_blend=tcod.BKGND_ALPHA(64),
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By FredTheHunter",
            fg=color.menu_title,
            bg=color.black,
            alignment=tcod.CENTER,
            bg_blend=tcod.BKGND_ALPHA(64),
        )

        menu_width = 24
        for i, text in enumerate(
            ["[N] Play a new game", "[C] Continue last game", "[Q] Quit"]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 2
0
    def on_render(self, console: tcod.Console) -> None:
        '''Render the main menu on a background image.'''
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            'SIMPLE ROGUE',
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            'By Kyle Burke',
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(
            ['[N] Play a new game', '[C] Continue last game', '[Q] Quit']):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 3
0
    def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "UNTITLED VAMPIRE PROJECT X",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By Emily",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(
            ["[N] New Game", "[C] Continue", "[Q] Quit"]
        ):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 4
0
    def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "WALL-MART AT AROUND MIDNIGHT",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "What a horrible night to have a curse.",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate([
                "[N] Play a new game",
                "[C] Continue last save",
                "[Q] Quit",
        ]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),  # TODO LOOK UP
            )
Esempio n. 5
0
    def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "WANNABE_ROGUELIKE",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By Barbapapou",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 32
        for i, text in enumerate([
                "[N] Play a new game", "[C] Continue last game",
                "[W] Warhammer 4 Character Sheet", "[Q] Quit"
        ]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 6
0
    def on_render(self, console: tcod.Console) -> None:

        console.print(
            console.width // 2,
            console.height // 2 - 10,
            "HOW TO PLAY",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = console.width // 4

        for i, text in enumerate([
                "UP ARROW........move up", "\n", "DOWN ARROW......move down",
                "\n", "RIGHT ARROW.....move right", "\n",
                "LEFT ARROW......move left", "\n", "ESCAPE..........exit game",
                "\n", "KEY V...............open history", "\n",
                "KEY G...............pick up item", "\n",
                "KEY D...............drop item", "\n",
                "KEY I...............open inventory", "\n",
                "KEY C...............open character tab", "\n",
                "KEY L...............toggle look around", "\n",
                "KEY Y...............use stairs"
        ]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 7
0
    def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "Under Desolation",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By Fenekito",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(
            ["[N]ew game", "[C]ontinue", "[Q]uit"]
        ):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 8
0
    def on_render(self, console: tcod.Console) -> None:
        """render the main menu on a bg img"""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "TOMBS OF THE ANCIENT KINGS",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By JJ",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(["[N]ew game", "[C]ontinue last game", "[Q]uit game"]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 9
0
    def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "LUKE AND THE ADVENTURE",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By Boofy the 2nd",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(
            ["[N] Play a new game", "[C] Continue saved game", "[Q] Quit"]
        ):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 10
0
    def on_render(self, console: tcod.Console) -> None:
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "PYTHON ROGUELIKE",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By Tanttinator",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(
            ["[N] Play a new game", "[C] Continue last game", "[Q] Quit"]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 11
0
    def on_render(self, console: tcod.Console) -> None:
        # this doesn't seem to work for some reason…
        # OpenGL on Mac issues, possibly…
        console.draw_semigraphics(BACKGROUND_IMAGE, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            constants.TITLE,
            fg=color.MENU_TITLE,
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "By Pangolin Games",
            fg=color.MENU_TITLE,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate(
            ["[N] Play a new game", "[C] Continue last game", "[Q] Quit"]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.MENU_TEXT,
                bg=color.BLACK,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 12
0
    def on_render(self, console: tcod.Console) -> None:
        """Render the main menu on a background image."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "PHONETICS ROGUELIKE",
            fg=color.menu_title,
            bg=color.black,
            alignment=tcod.CENTER,
            bg_blend=tcod.BKGND_ALPHA(64),
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By @entrapolarity, @chenopodiumlang, and @esil-11",
            fg=color.menu_title,
            bg=color.black,
            alignment=tcod.CENTER,
            bg_blend=tcod.BKGND_ALPHA(64),
        )

        menu_width = 24
        for i, text in enumerate(
            ["(N) Play a new game", "(C) Continue last game", "(H) Help", "(Q) Quit"]
        ):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )
Esempio n. 13
0
    def on_render(self, console: tcod.Console) -> None:
        console.draw_semigraphics(background_image, 0, 0)

        console.print(console.width // 2,
                      console.height // 2 - 4,
                      "TOMBS OF THE ANCIENT KINGS",
                      fg=color.menu_title,
                      alignment=tcod.CENTER)
        console.print(console.width // 2,
                      console.height - 2,
                      "By Akhier Dragonheart",
                      fg=color.menu_title,
                      alignment=tcod.CENTER)

        menu_width = 24
        for i, text in enumerate(
            ["[N] Play a new game", "[C] Continue last game", "[Q] Quit"]):
            console.print(console.width // 2,
                          console.height // 2 - 2 + i,
                          text.ljust(menu_width),
                          fg=color.menu_text,
                          bg=color.black,
                          alignment=tcod.CENTER,
                          bg_blend=tcod.BKGND_ALPHA(64))
Esempio n. 14
0
def render_main_menu(console):
    """Renders the main menu and options."""
    # Load the background image and remove the alpha channel.
    background_image = tcod.image.load(settings.bg_img)[:, :, :3]
    console.draw_semigraphics(background_image, 0, 0)

    console.print(
        console.width // 2,
        console.height // 2 - 4,
        settings.title_extended,
        fg=color.menu_title,
        alignment=tcod.CENTER,
    )
    console.print(
        console.width // 2,
        console.height - 2,
        f"Version {settings.version}",
        fg=color.menu_title,
        alignment=tcod.CENTER,
    )

    menu_width = settings.menu_width

    for i, text in enumerate([
            "[N] Play a new game", "[C] Continue last game",
            "[G] Generate test map", "[Q] Quit"
    ]):
        console.print(
            console.width // 2,
            console.height // 2 - 2 + i,
            text.ljust(menu_width),
            fg=color.menu_text,
            bg=color.black,
            alignment=tcod.CENTER,
            bg_blend=tcod.BKGND_ALPHA(64),
        )
Esempio n. 15
0
def test_alpha_blend(console):
    for i in range(256):
        libtcodpy.console_put_char(console, 0, 0, 'x',
                                   libtcodpy.BKGND_ALPHA(i))
        libtcodpy.console_put_char(console, 0, 0, 'x',
                                   libtcodpy.BKGND_ADDALPHA(i))
Esempio n. 16
0
    def on_render(self, console: tcod.Console) -> None:
        """Рендерит главное меню на фоновом изображении."""
        console.draw_semigraphics(background_image, 0, 0)

        console.print(
            console.width // 2,
            console.height // 2 - 4,
            "SPACESHIP DEFENDER",
            fg=color.white,
            bg=(34, 2, 87),
            bg_blend=tcod.BKGND_ALPHA(50),
            alignment=tcod.CENTER,
        )
        console.print(
            console.width // 2,
            console.height - 2,
            "By Sasha and Liza",
            fg=color.menu_title,
            alignment=tcod.CENTER,
        )

        menu_width = 24
        for i, text in enumerate([
                "                                          ",
                " Hello, stranger!                         ",
                " You are exploring the universe but your  ",
                " shuttle has been attacked by aliens.     ",
                " They have damaged the system and         ",
                " your mission is to fight the enemies     ",
                " making your way in the darkness. Also,   ",
                " the key of the spaceship has been lost   ",
                " and you will have to find it to continue ",
                " travelling. You'll find some arms and    ",
                " medicine which will help you.            ",
                "                Good luck!                ",
                "",
        ]):
            console.print(
                console.width // 2,
                console.height // 2 - 2 + i,
                text.ljust(menu_width),
                fg=color.menu_text,
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )

        for i, text in enumerate([
                "    [3] Easy",
                "    [5] Normal",
                "    [8] Hard",
        ]):
            console.print(
                console.width // 2,
                38 + i,
                text.ljust(menu_width),
                fg=(52, 163, 42),
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )

        for i, text in enumerate([
                "    [Q] Quit",
                "",
        ]):
            console.print(
                console.width // 2,
                41 + i,
                text.ljust(menu_width),
                fg=(196, 0, 0),
                bg=color.black,
                alignment=tcod.CENTER,
                bg_blend=tcod.BKGND_ALPHA(64),
            )