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."""
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()