def get_local_tile_map(tileobj, crawltiles=2, mapsize=5):
    """
    Builds a 2D list of tiles, representing an x/y grid of tiles sorrounding
    the players current position.

    :param text_game_maker.tile.tile.Tile tileobj: starting tile
    :param int crawltiles: maximum tiles to travel from starting tile
    :param int mapsize: map height and width in tiles
    :return: 2D list representing x/y grind of tiles around player
    """
    tilemap = []
    for _ in range(mapsize):
        tilemap.append([None] * mapsize)
    pos = 0, 0
    tilestack = [(tileobj, None, None)]
    seen = []
    movetable = {'north': lambda : (pos[0], pos[1] - 1), 'south': lambda :
        (pos[0], pos[1] + 1), 'east': lambda : (pos[0] + 1, pos[1]), 'west':
        lambda : (pos[0] - 1, pos[1])}
    while tilestack:
        tile, newpos, movedir = tilestack.pop(0)
        if newpos:
            pos = newpos
        if tile in seen:
            continue
        seen.append(tile)
        if movedir:
            x, y = movetable[movedir]()
            pos = x, y
        if -crawltiles <= pos[0] <= crawltiles and -crawltiles <= pos[1
            ] <= crawltiles:
            tilemap[pos[1] + crawltiles][pos[0] + crawltiles] = tile
        for direction in movetable:
            adj = getattr(tile, direction)
            if not adj:
                continue
            tilestack.append((adj, pos, direction))
    return tilemap
