Exemplo n.º 1
0
def test_map_1():
    m = Map(5, 4)
    print(m)
    print(len(m._array[0]))
    m[2][1] = Tile('B', 1, False)
    print(m)
    print(m.get_size)
Exemplo n.º 2
0
def test_map_access():
    m = Map(5, 4)
    new_value = 'TEST'
    m[2][1] = Tile(new_value, 1, False)
    print(m)
    expected_map = """\
****** FOR DEBUG PURPOSE ONLY
tile, tile, tile, tile, tile, 
tile, tile, TEST, tile, tile, 
tile, tile, tile, tile, tile, 
tile, tile, tile, tile, tile, 
"""
    assert str(m) == expected_map
    # Test another assignment
    m[3][2] = Tile(new_value, 1, False)
    expected_map2 = """\
****** FOR DEBUG PURPOSE ONLY
tile, tile, tile, tile, tile, 
tile, tile, TEST, tile, tile, 
tile, tile, tile, TEST, tile, 
tile, tile, tile, tile, tile, 
"""
    assert str(m) == expected_map2
Exemplo n.º 3
0
        if sys.argv[1] == '-d':
            debug = True

    # Load Config and Pass Values
    config = Config(window)
    user = User(window, config, debug)

    # Draw Game Title Screen
    drawer = Drawer(window, debug)
    drawer.title_screen()

    # Take user input
    running = user.main_menu(config)

    # Initialize Game Map and Player
    game_map = Map()
    player = Player()

    # Main Loop
    while running:
        # Update the map, player, and user for new game
        game_map.update_map(config, debug)
        player.update_player(config, debug)
        user.update_store(config, debug)

        # set playing to yes
        playing = 1

        # Starts of Map Reveal
        player.player_view(1, game_map)
        while playing != 0:
Exemplo n.º 4
0
def test_map_generation():
    # TODO(nick) implement test once config is finished
    Map.generate_map(None)
    assert False
Exemplo n.º 5
0
def test_map_get_size():
    expected = (5, 4)
    m = Map(*expected) # same as Map(5, 4)
    print(m.get_size)
    assert m.get_size == expected
Exemplo n.º 6
0
def test_map_construction():
    m = Map(5, 4)
    m = Map(1, 1)
    m = Map(100, 1)