From 019f4da916336f4e58c5f417d459d15aab488a9f Mon Sep 17 00:00:00 2001 From: pascald Date: Sat, 3 May 2025 01:05:29 +0200 Subject: [PATCH] final changes for better touch function --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 05390f3..9f8d2f3 100644 --- a/main.py +++ b/main.py @@ -79,7 +79,7 @@ async def touch(event): if event.type == pygame.FINGERDOWN and not touch_start: touch_start = (event.x * SCREEN_WIDTH, event.y * SCREEN_HEIGHT) touch_start_time = time.time() - print("touch_start:") + print("touch_start") return None elif event.type == pygame.FINGERUP and touch_start: @@ -87,7 +87,7 @@ async def touch(event): duration = time.time() - touch_start_time dx = end[0] - touch_start[0] dy = end[1] - touch_start[1] - print("touch_end:") + print("touch_end") print(f"Touch dx={dx}, dy={dy}, duration={duration}") touch_start = None @@ -100,7 +100,7 @@ async def touch(event): elif dy < -50 and abs(dx) < 80 and duration > 0.3: return "ontop" else: - print("touch_problem") + print("touch problem") return None