1
0
Fork 0

Disallow swipes while confirmation prompt is displayed

Signed-off-by: George Griffin <george@menomnom.com>
This commit is contained in:
George Griffin 2021-01-12 23:42:58 -05:00 committed by Daniel Thompson
parent f4f7aac7fd
commit ae6e2ff289

View file

@ -114,14 +114,15 @@ class Play2048App():
"""Notify the application of a touchscreen swipe event.""" """Notify the application of a touchscreen swipe event."""
moved = False moved = False
if event[0] == wasp.EventType.UP: if self._state == 0:
moved = self._shift(1,False) if event[0] == wasp.EventType.UP:
elif event[0] == wasp.EventType.DOWN: moved = self._shift(1,False)
moved = self._shift(-1,False) elif event[0] == wasp.EventType.DOWN:
elif event[0] == wasp.EventType.LEFT: moved = self._shift(-1,False)
moved = self._shift(1,True) elif event[0] == wasp.EventType.LEFT:
elif event[0] == wasp.EventType.RIGHT: moved = self._shift(1,True)
moved = self._shift(-1,True) elif event[0] == wasp.EventType.RIGHT:
moved = self._shift(-1,True)
if moved: if moved:
self._add_tile() self._add_tile()