Disallow swipes while confirmation prompt is displayed
Signed-off-by: George Griffin <george@menomnom.com>
This commit is contained in:
parent
f4f7aac7fd
commit
ae6e2ff289
1 changed files with 9 additions and 8 deletions
|
@ -114,14 +114,15 @@ class Play2048App():
|
|||
"""Notify the application of a touchscreen swipe event."""
|
||||
moved = False
|
||||
|
||||
if event[0] == wasp.EventType.UP:
|
||||
moved = self._shift(1,False)
|
||||
elif event[0] == wasp.EventType.DOWN:
|
||||
moved = self._shift(-1,False)
|
||||
elif event[0] == wasp.EventType.LEFT:
|
||||
moved = self._shift(1,True)
|
||||
elif event[0] == wasp.EventType.RIGHT:
|
||||
moved = self._shift(-1,True)
|
||||
if self._state == 0:
|
||||
if event[0] == wasp.EventType.UP:
|
||||
moved = self._shift(1,False)
|
||||
elif event[0] == wasp.EventType.DOWN:
|
||||
moved = self._shift(-1,False)
|
||||
elif event[0] == wasp.EventType.LEFT:
|
||||
moved = self._shift(1,True)
|
||||
elif event[0] == wasp.EventType.RIGHT:
|
||||
moved = self._shift(-1,True)
|
||||
|
||||
if moved:
|
||||
self._add_tile()
|
||||
|
|
Loading…
Reference in a new issue