Calculating nearest tiles