this function will take two object and tell if one is touching the other, and based on this a second function in this code will select the mode of user inputs allowed