pos = self.to_local(*pos)
return (int(pos[0] / TILE_SIZE), int(pos[1] / TILE_SIZE))
+ def _near_player(self, pos):
+ return (abs(pos[0] - self.player.pos[0]) < 2 and
+ abs(pos[1] - self.player.pos[1]) < 2)
+
def on_touch_down(self, touch):
pos = self._calc_mouse_pos(touch.pos)
- if pos == self.player.pos:
+ if self._near_player(pos):
self.mouse_move = True
self.mouse_start = pos