def main(argv=()):
    game = make_game(int(argv[1]) if len(argv) > 1 else 0)

    ui = human_ui.CursesUi(
        keys_to_actions={
            # Basic movement.
            curses.KEY_UP: 0,
            curses.KEY_DOWN: 1,
            curses.KEY_LEFT: 2,
            curses.KEY_RIGHT: 3,
            -1: 4,  # Do nothing.
            # Shoot aperture gun.
            'w': 5,
            'a': 6,
            's': 7,
            'd': 8,
            # Quit game.
            'q': 9,
            'Q': 9,
        },
        delay=50,
        colour_fg=FG_COLOURS,
        colour_bg=BG_COLOURS)

    ui.play(game)
def main(argv=()):
    # Build a Warehouse Manager game.
    game = make_game(int(argv[1]) if len(argv) > 1 else 0)

    # Build an ObservationCharacterRepainter that will make all of the boxes in
    # the warehouse look the same.
    repainter = rendering.ObservationCharacterRepainter(
        WAREHOUSE_REPAINT_MAPPING)

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(keys_to_actions={
        curses.KEY_UP: 0,
        curses.KEY_DOWN: 1,
        curses.KEY_LEFT: 2,
        curses.KEY_RIGHT: 3,
        -1: 4,
        'q': 5,
        'Q': 5
    },
                           repainter=repainter,
                           delay=100,
                           colour_fg=WAREHOUSE_FG_COLOURS,
                           colour_bg=WAREHOUSE_BG_COLOURS)

    # Let the game begin!
    ui.play(game)
def main(argv=()):
    del argv  # Unused.

    # Build an Extraterrestrial Marauders game.
    game = make_game()

    # Build an ObservationCharacterRepainter that will make laser bolts of the
    # same type all look identical.
    repainter = rendering.ObservationCharacterRepainter(LASER_REPAINT_MAPPING)

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(
        keys_to_actions={
            curses.KEY_LEFT: 0,
            curses.KEY_RIGHT: 1,
            ' ': 2,  # shoot
            -1: 3,  # no-op
            'q': 4
        },  # quit
        repainter=repainter,
        delay=300,
        colour_fg=COLOURS_FG,
        colour_bg=COLOURS_BG)

    # Let the game begin!
    ui.play(game)
Beispiel #4
0
def main(argv=()):
    # Build a Scrolly Maze game.
    game = make_game(int(argv[1]) if len(argv) > 1 else 0)

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(
        keys_to_actions={curses.KEY_UP: 0, curses.KEY_DOWN: 1,
                         curses.KEY_LEFT: 2, curses.KEY_RIGHT: 3,
                         -1: 4,
                         'q': 5, 'Q': 5},
        delay=100, colour_fg=COLOUR_FG, colour_bg=COLOUR_BG)

    # Let the game begin!
    ui.play(game)
def main(argv=()):
    game = make_game(int(argv[1]) if len(argv) > 1 else 0)

    keys_to_actions = {
        curses.KEY_UP: 0,
        curses.KEY_LEFT: 1,
        curses.KEY_RIGHT: 2,
        -1: 3,
    }

    ui = human_ui.CursesUi(keys_to_actions=keys_to_actions,
                           delay=500,
                           colour_fg=COLOURS)

    ui.play(game)
Beispiel #6
0
def main(argv=()):
    del argv  # Unused.

    # Build a cliff-walk game.
    game = make_game()

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(
        keys_to_actions={curses.KEY_UP: 0, curses.KEY_DOWN: 1,
                         curses.KEY_LEFT: 2, curses.KEY_RIGHT: 3,
                         -1: 4},
        delay=200)

    # Let the game begin!
    ui.play(game)
def main(argv=()):
    del argv  # Unused.

    # Build a Hello World game.
    game = make_game()

    # Log a message in its Plot object.
    game.the_plot.log('Hello, world!')

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(
        keys_to_actions={curses.KEY_UP: 0, curses.KEY_DOWN: 1, curses.KEY_LEFT: 2,
                         curses.KEY_RIGHT: 3, 'q': 4, 'Q': 4, -1: 5},
        delay=50, colour_fg=HELLO_COLOURS)

    # Let the game begin!
    ui.play(game)
def main(argv=()):
    del argv  # Unused.

    # Build a Fluvial Natation game.
    game = make_game()

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(keys_to_actions={
        curses.KEY_LEFT: 0,
        curses.KEY_RIGHT: 1,
        -1: 2
    },
                           delay=200,
                           colour_fg=COLOURS_FG,
                           colour_bg=COLOURS_BG)

    # Let the game begin!
    ui.play(game)
Beispiel #9
0
def main(argv=()):
    game = make_game()

    repainter = rendering.ObservationCharacterRepainter(
        INVERSE_REPAINT_MAPPING)
    ui = human_ui.CursesUi(
        keys_to_actions={
            # Basic movement.
            '1': 0,
            '2': 1,
            '3': 2,
            '4': 3,
            '5': 4,
            '6': 5,
            '7': 6,
            'q': 7,
            -1: 8
        },
        repainter=repainter,
        delay=10)

    ui.play(game)
def main(argv=()):
    del argv  # Unused.

    # Build an Apprehend game.
    game = make_game()

    # Build an ObservationCharacterRepainter that will make the player and the
    # ball look identical.
    repainter = rendering.ObservationCharacterRepainter(REPAINT_MAPPING)

    # Make a CursesUi to play it with.
    ui = human_ui.CursesUi(keys_to_actions={
        curses.KEY_LEFT: 0,
        curses.KEY_RIGHT: 1,
        -1: 2
    },
                           repainter=repainter,
                           delay=500,
                           colour_fg=COLOURS)

    # Let the game begin!
    ui.play(game)