projects
/
erdslangetjie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04a0709
)
Don't be as stict when deciding if the player has pressed on the correct sprite ...
author
Neil
<neil@dip.sun.ac.za>
Sat, 20 Apr 2013 09:34:31 +0000
(11:34 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Sat, 20 Apr 2013 09:34:31 +0000
(11:34 +0200)
erdslangetjie/__main__.py
patch
|
blob
|
history
diff --git
a/erdslangetjie/__main__.py
b/erdslangetjie/__main__.py
index 8121eb92436228066feaae21e2d6de4962ac6582..48054197543eb14059ffadfe796ab5604102430a 100644
(file)
--- 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