def get_area_by_player_position(areas, x, y):
    """
    This function checks the area the player is in given its position in the maps
    """
    epsilon = 1  # Variance of 1 block
    for i, area in areas:
        if (
            area["x1"] - epsilon <= x <= area["x2"] + epsilon
            and area["y1"] - epsilon <= y <= area["y2"] + epsilon
        ):
            return i, area["id"]