From c951897737c1c98afb548ca635a2a1fa19f02938 Mon Sep 17 00:00:00 2001 From: pascald Date: Fri, 2 May 2025 23:35:45 +0200 Subject: [PATCH] better touch function --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a81d1bb..929a82e 100644 --- a/main.py +++ b/main.py @@ -633,6 +633,7 @@ async def main(): global running, can_use_tilt, can_use_on_top, game_finished global current_case, transition_counter, state global screen, clock, font, instruction_image, background_image + global touch_start await init_game() load_case_images() @@ -673,7 +674,7 @@ async def main(): for event in pygame.event.get(): if event.type == pygame.QUIT: running = False - elif event.type == pygame.KEYDOWN or event.type == pygame.JOYBUTTONDOWN or event.type == pygame.JOYHATMOTION or event.type == pygame.FINGERDOWN: + elif event.type == pygame.KEYDOWN or event.type == pygame.JOYBUTTONDOWN or event.type == pygame.JOYHATMOTION or event.type == pygame.FINGERDOWN or touch_start: if state == 1: # PLAYING if ((event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT) or (event.type == pygame.JOYHATMOTION and event.value[0] == -1) or