I want to know what\'s the best way of detecting the collision with a diagonal obstacle on a html canvas. Checking the x and y coordinates of the player against the coordinates