Added function to get tile position from X/Y coordinates