From 902dc730258c6303339c105e49eb62499598de0e Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 20 Apr 2013 11:34:31 +0200 Subject: [PATCH] Don't be as stict when deciding if the player has pressed on the correct sprite - should make android play easier --- erdslangetjie/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erdslangetjie/__main__.py b/erdslangetjie/__main__.py index 8121eb9..4805419 100644 --- a/erdslangetjie/__main__.py +++ b/erdslangetjie/__main__.py @@ -286,9 +286,13 @@ class GameWindow(RelativeLayout): 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 -- 2.34.1