def check_if_inside(x, y, obj):
    """
    Helper function used to check if point at window is inside given object.
    :param x: integer value of x axis
    :param y: integer value of y axis
    :param obj: pyglet object with x, y, with, height properties
    :return: bool True is point is inside object, False otherwise
    """
    left_border = obj.x - obj.width / 2
    right_border = obj.x + obj.width / 2
    upper_border = obj.y + obj.height / 2
    bottom_border = obj.y - obj.height / 2
    if left_border <= x <= right_border and bottom_border <= y <= upper_border:
        return True
    return False